Skip to content

Commit b3d0c6c

Browse files
committed
Add the bypass_standard_checks input to bypass checks when testing
1 parent 4127036 commit b3d0c6c

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/release-proposal-dispatch.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,26 @@ on:
3131
required: false
3232
type: string
3333
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
3441

3542
concurrency:
3643
group: release-proposal-dispatch-group
3744
cancel-in-progress: false
3845

3946
env:
4047
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' }}
4250

4351
jobs:
4452
check-proposal-ongoing:
53+
if: ${{ !inputs.bypass_standard_checks }}
4554
runs-on: ubuntu-latest
4655
steps:
4756
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
@@ -51,7 +60,7 @@ jobs:
5160
- name: Check if a release proposal is ongoing
5261
run: |
5362
# 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 }}/*/*")
5564
if [ -n "$EXISTING_BRANCHES" ]; then
5665
echo "Error: A release proposal is ongoing. Please cancel it or wait for it to be merged." >&2
5766
echo "Existing branches:"
@@ -88,7 +97,7 @@ jobs:
8897
echo "User is not part of apm-common-components-core"
8998
exit 1
9099
fi
91-
100+
92101
cargo-release:
93102
permissions:
94103
id-token: write # Enable OIDC
@@ -216,7 +225,7 @@ jobs:
216225
id: ephemeral-branch
217226
run: |
218227
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"
220229
git checkout -b "$EPHEMERAL_BRANCH"
221230
git push origin "$EPHEMERAL_BRANCH"
222231
echo "Ephemeral release branch created: $EPHEMERAL_BRANCH branch ($(git rev-parse --short HEAD))"
@@ -351,7 +360,7 @@ jobs:
351360
352361
# if there is a tag more recent than $TAG, continue the loop
353362
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
355364
echo "Tag $TAG is not the latest. Latest is: $LATEST_TAG. main branch has the latest release for $NAME"
356365
echo "Skipping release for $NAME"
357366
continue

0 commit comments

Comments
 (0)