|
31 | 31 | required: false |
32 | 32 | type: string |
33 | 33 | default: '' |
| 34 | + bypass_standard_checks: |
| 35 | + description: > |
| 36 | + Skip ongoing-proposal checks. Proposal branches use prefix |
| 37 | + release-proposal-testing so they do not collide with normal release-proposal/* runs. |
| 38 | + required: false |
| 39 | + type: boolean |
| 40 | + default: false |
34 | 41 |
|
35 | 42 | concurrency: |
36 | 43 | group: release-proposal-dispatch-group |
37 | 44 | cancel-in-progress: false |
38 | 45 |
|
39 | 46 | env: |
40 | 47 | MAIN_BRANCH: main |
41 | | - PROPOSAL_BRANCH_PREFIX: release-proposal |
| 48 | + RELEASE_BRANCH_PREFIX: ${{ inputs.bypass_standard_checks && 'release-testing' || 'release' }} |
| 49 | + PROPOSAL_BRANCH_PREFIX: ${{ inputs.bypass_standard_checks && 'release-proposal-testing' || 'release-proposal' }} |
42 | 50 |
|
43 | 51 | jobs: |
44 | 52 | check-proposal-ongoing: |
| 53 | + if: ${{ !inputs.bypass_standard_checks }} |
45 | 54 | runs-on: ubuntu-latest |
46 | 55 | steps: |
47 | 56 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 |
|
51 | 60 | - name: Check if a release proposal is ongoing |
52 | 61 | run: | |
53 | 62 | # Check if there are any proposal branches or ephemeral release branches (release/*/*) |
54 | | - EXISTING_BRANCHES=$(git branch -r --list "origin/${{ env.PROPOSAL_BRANCH_PREFIX }}/*" "origin/release/*/*") |
| 63 | + EXISTING_BRANCHES=$(git branch -r --list "origin/${{ env.PROPOSAL_BRANCH_PREFIX }}/*" "origin/${{ env.RELEASE_BRANCH_PREFIX }}/*/*") |
55 | 64 | if [ -n "$EXISTING_BRANCHES" ]; then |
56 | 65 | echo "Error: A release proposal is ongoing. Please cancel it or wait for it to be merged." >&2 |
57 | 66 | echo "Existing branches:" |
|
88 | 97 | echo "User is not part of apm-common-components-core" |
89 | 98 | exit 1 |
90 | 99 | fi |
91 | | - |
| 100 | +
|
92 | 101 | cargo-release: |
93 | 102 | permissions: |
94 | 103 | id-token: write # Enable OIDC |
@@ -216,7 +225,7 @@ jobs: |
216 | 225 | id: ephemeral-branch |
217 | 226 | run: | |
218 | 227 | TIMESTAMP=$(date +%Y%m%d-%H%M%S) |
219 | | - EPHEMERAL_BRANCH="release/${{ inputs.crate }}/$TIMESTAMP" |
| 228 | + EPHEMERAL_BRANCH="${{ env.RELEASE_BRANCH_PREFIX }}/${{ inputs.crate }}/$TIMESTAMP" |
220 | 229 | git checkout -b "$EPHEMERAL_BRANCH" |
221 | 230 | git push origin "$EPHEMERAL_BRANCH" |
222 | 231 | echo "Ephemeral release branch created: $EPHEMERAL_BRANCH branch ($(git rev-parse --short HEAD))" |
@@ -351,7 +360,7 @@ jobs: |
351 | 360 |
|
352 | 361 | # if there is a tag more recent than $TAG, continue the loop |
353 | 362 | LATEST_TAG=$(git tag -l "$TAG_PREFIX*" --sort=-v:refname | head -1) |
354 | | - if [ "$LATEST_TAG" != "$TAG" ]; then |
| 363 | + if [ "$LATEST_TAG" != "$TAG" && ${{ !inputs.bypass_standard_checks }} ]; then |
355 | 364 | echo "Tag $TAG is not the latest. Latest is: $LATEST_TAG. main branch has the latest release for $NAME" |
356 | 365 | echo "Skipping release for $NAME" |
357 | 366 | continue |
|
0 commit comments