Skip to content

Commit 719f999

Browse files
authored
ci: replace classic pat with github app token (#16)
1 parent fbd2ea2 commit 719f999

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/release-binaries.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
jobs:
1010
release:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write # goreleaser uploads release assets
14+
packages: write # push images to ghcr.io
1215

1316
steps:
1417
- uses: actions/checkout@v4
@@ -22,8 +25,8 @@ jobs:
2225
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
2326
with:
2427
registry: ghcr.io
25-
username: ${{ secrets.GHCR_USER_NAME }}
26-
password: ${{ secrets.WORKFLOW_TOKEN }}
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
2730

2831
- name: Run GoReleaser
2932
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ jobs:
1111
name: Release Please
1212
runs-on: ubuntu-latest
1313
steps:
14+
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
15+
id: app-token
16+
with:
17+
client-id: ${{ secrets.RELEASE_BOT_APP_ID }}
18+
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
19+
permission-contents: write
20+
permission-pull-requests: write
1421
- uses: googleapis/release-please-action@5792afc6b46e9bb55deda9eda973a18c226bc3fc # v4.1.5
1522
with:
16-
token: ${{ secrets.WORKFLOW_TOKEN }} # We need to set the PAT so the publish workflow can be triggered
23+
token: ${{ steps.app-token.outputs.token }} # App token so the tag/release created by release-please can trigger other workflows

0 commit comments

Comments
 (0)