Skip to content

Commit 0858a40

Browse files
committed
Release dispatch
1 parent 9089223 commit 0858a40

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Release - Open a release PR
2+
on:
3+
# TODO: Remove this once the workflow is working
4+
push:
5+
branches:
6+
- igor/versioning/release-dispatch
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: Version to release
11+
required: true
12+
type: string
13+
14+
env:
15+
BRANCH_NAME: test-main
16+
VERSION: ${{ inputs.version || '0.3.0' }}
17+
18+
jobs:
19+
freeze-branch:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
id-token: write # Needed to federate tokens.
23+
outputs:
24+
frozen: false
25+
steps:
26+
- name: Get token
27+
uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
28+
id: octo-sts
29+
with:
30+
scope: DataDog/dd-trace-rs
31+
policy: release-dispatch
32+
- name: Freeze branch
33+
run: |
34+
echo "${{ steps.octo-sts.outputs.token }}" | gh auth login --with-token
35+
# echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
36+
37+
gh api -X GET -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
38+
/repos/DataDog/dd-trace-rs/branches/${{ env.BRANCH_NAME }}/protection
39+
40+
41+
# gh api -X POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
42+
# /repos/DataDog/dd-trace-rs/branches/${{ env.BRANCH_NAME }}/protection \
43+
# -f '{"required_status_checks": null, "enforce_admins": null, "restrictions": null}' \
44+
# -f '{"required_pull_request_reviews": null}' \
45+
# -f '{"required_linear_history": null, "allow_force_pushes": null, "allow_deletions": null}' \
46+
# -f '{"dismiss_stale_reviews": null, "require_code_owner_reviews": null, "required_approving_review_count": null}' \
47+
# -f '{"restrictions": null}' \
48+
echo "frozen=false" >> $GITHUB_OUTPUT
49+
# env:
50+
# GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }}
51+
52+
# make-release-pr:
53+
# permissions:
54+
# id-token: write # Enable OIDC
55+
# pull-requests: write
56+
# contents: write
57+
# runs-on: ubuntu-latest
58+
# needs: freeze-branch
59+
# if: needs.freeze-branch.outputs.frozen == 'true'
60+
# steps:
61+
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
62+
# - uses: chainguard-dev/actions/setup-gitsign@0cda751b114eb55c388e88f7479292668165602a # v1.0.2
63+
# - name: Install cargo-release
64+
# uses: taiki-e/install-action@d6d752794628f1e1fffa3c4d3c8874e06f043d50 # 2.62.15
65+
# with:
66+
# tool: cargo-release
67+
68+
# # TODO: add release notes to the PR description ${{ steps.extract-release-notes.outputs.release-notes }}
69+
# - uses: cargo-bins/release-pr@0c019c0e5a6b9f722578d231d43ba900cacc5ffa # 2.1.3
70+
# with:
71+
# github-token: ${{ secrets.GITHUB_TOKEN }}
72+
# version: ${{ env.VERSION }}
73+
# crate-name: datadog-opentelemetry
74+
# base-branch: ${{ env.BRANCH_NAME }}
75+
# # check-semver: "true"

0 commit comments

Comments
 (0)