Skip to content

Commit 779e630

Browse files
committed
ci: add GitHub App token support for release-please
Enables optional GitHub App auth for branch protection bypass: - Falls back to GITHUB_TOKEN if APP_ID/APP_PRIVATE_KEY not set - Controlled via USE_APP_TOKEN repository variable
1 parent 9387148 commit 779e630

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/release-please.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,23 @@ jobs:
1717
tag_name: ${{ steps.release.outputs.tag_name }}
1818
version: ${{ steps.release.outputs.version }}
1919
steps:
20+
# Use GitHub App for token vending (avoids branch protection issues with GITHUB_TOKEN)
21+
# If APP_ID/APP_PRIVATE_KEY not set, falls back to GITHUB_TOKEN
22+
- name: Generate GitHub App token
23+
id: app-token
24+
uses: actions/create-github-app-token@v2
25+
if: ${{ vars.USE_APP_TOKEN == 'true' }}
26+
with:
27+
app-id: ${{ secrets.APP_ID }}
28+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
29+
2030
- name: Run release-please
2131
id: release
2232
uses: googleapis/release-please-action@v4
2333
with:
2434
manifest-file: .release-please-manifest.json
2535
config-file: release-please-config.json
26-
token: ${{ secrets.GITHUB_TOKEN }}
36+
token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
2737

2838
build-wheels:
2939
name: Build wheels (${{ matrix.target }})

0 commit comments

Comments
 (0)