Skip to content

Commit 9af787b

Browse files
jeremyederclaude
andauthored
fix(ci): use GitHub App token for semantic-release to bypass branch ruleset (#32)
The release workflow was failing because GITHUB_TOKEN (github-actions[bot]) cannot push directly to main when branch protection requires pull requests. On GitHub Free, the built-in GitHub Actions integration cannot be added as a bypass actor in rulesets. Switch to authenticating via the ambient-code GitHub App using actions/create-github-app-token, which generates a short-lived token that can bypass the "Protect main" ruleset. Requires repo secrets: RELEASE_APP_ID, RELEASE_APP_PRIVATE_KEY Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8301653 commit 9af787b

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,19 @@ jobs:
1919
url: https://pypi.org/project/mcp-acp/
2020

2121
steps:
22+
- name: Generate release token
23+
id: app-token
24+
uses: actions/create-github-app-token@v1
25+
with:
26+
app-id: ${{ secrets.RELEASE_APP_ID }}
27+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
28+
2229
- name: Checkout code
2330
uses: actions/checkout@v4
2431
with:
2532
fetch-depth: 0
2633
persist-credentials: true
34+
token: ${{ steps.app-token.outputs.token }}
2735

2836
- name: Set up Python
2937
uses: actions/setup-python@v5
@@ -40,7 +48,7 @@ jobs:
4048
id: release
4149
uses: python-semantic-release/python-semantic-release@v9.15.2
4250
with:
43-
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
github_token: ${{ steps.app-token.outputs.token }}
4452

4553
- name: Clean stale build artifacts
4654
if: steps.release.outputs.released == 'true'
@@ -60,4 +68,4 @@ jobs:
6068
if: steps.release.outputs.released == 'true'
6169
uses: python-semantic-release/publish-action@v9.15.2
6270
with:
63-
github_token: ${{ secrets.GITHUB_TOKEN }}
71+
github_token: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)