Skip to content

Commit aff9078

Browse files
authored
ci: create release branch with the App token to bypass the merge queue rule (#10931)
1 parent bc614b3 commit aff9078

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/release-please.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ jobs:
6565
6666
release-tag:
6767
runs-on: ubuntu-2404-2core
68-
if: ${{ startsWith(github.event.head_commit.message, 'release:') }}
68+
# Skip the branch-creation push (created == true) to avoid re-running on the duplicate tag.
69+
if: ${{ startsWith(github.event.head_commit.message, 'release:') && !github.event.created }}
6970
steps:
7071
# Since skip-github-release is specified, the outputs of googleapis/release-please-action cannot be used.
7172
# Therefore, we need to parse the version ourselves.
@@ -114,7 +115,8 @@ jobs:
114115
env:
115116
RELEASE_BRANCH: ${{ steps.extract_info.outputs.release_branch }}
116117
with:
117-
github-token: ${{ secrets.GITHUB_TOKEN }} # Should not trigger the workflow again
118+
# GITHUB_TOKEN cannot be a ruleset bypass actor; use the App token to bypass the merge queue rule.
119+
github-token: ${{ steps.app-token.outputs.token }}
118120
script: |
119121
const releaseBranch = process.env.RELEASE_BRANCH;
120122
await github.rest.git.createRef({

0 commit comments

Comments
 (0)