Skip to content

Commit 06c8e5e

Browse files
committed
ci(release): authenticate semantic-release via Flanksource GitHub App
The Create Release workflow failed at job setup with "Repository access blocked" and the default GITHUB_TOKEN cannot push release tags / create releases under current org policy, so no semver tag was being cut on push to master. Mint a GitHub App installation token (actions/create-github-app-token) from the Flanksource App credentials (FLANKSOURCE_APP_ID / FLANKSOURCE_APP_SECRET) and use it for both the checkout and the semantic-release step.
1 parent a599996 commit 06c8e5e

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,23 @@ jobs:
2424
with:
2525
egress-policy: audit
2626

27+
# Mint a GitHub App installation token for the Flanksource App so
28+
# semantic-release can push the release tag and create the GitHub Release.
29+
# The default GITHUB_TOKEN is blocked from these writes by org policy.
30+
- name: Generate GitHub App token
31+
id: app-token
32+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
33+
with:
34+
app-id: ${{ secrets.FLANKSOURCE_APP_ID }}
35+
private-key: ${{ secrets.FLANKSOURCE_APP_SECRET }}
36+
2737
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
38+
with:
39+
token: ${{ steps.app-token.outputs.token }}
2840
- uses: codfish/semantic-release-action@b621d34fabe0940f031e89b6ebfea28322892a10 # v3.5.0
2941
id: semantic
3042
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
3244

3345
bump-clients:
3446
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)