Skip to content

Commit 1fa0932

Browse files
fix: dispatch release without PAT checkout (#40)
Co-authored-by: Genie Automagik <genie@namastex.ai>
1 parent 3208983 commit 1fa0932

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/auto-release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: write
9+
actions: write
910

1011
jobs:
1112
tag:
@@ -16,8 +17,8 @@ jobs:
1617
- uses: actions/checkout@v4
1718
with:
1819
fetch-depth: 0
19-
# PAT required: GITHUB_TOKEN tag pushes don't trigger other workflows
20-
token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
20+
# Use the built-in token for checkout; dispatch release explicitly after pushing the tag.
21+
token: ${{ github.token }}
2122

2223
- name: Compute next calver tag
2324
id: calver
@@ -36,11 +37,12 @@ jobs:
3637
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
3738
echo "Next tag: ${TAG}"
3839
39-
- name: Create and push tag
40+
- name: Create tag and dispatch release
4041
env:
41-
GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
42+
GH_TOKEN: ${{ github.token }}
4243
run: |
4344
git config user.name "github-actions[bot]"
4445
git config user.email "github-actions[bot]@users.noreply.github.com"
4546
git tag -a "${{ steps.calver.outputs.tag }}" -m "Release ${{ steps.calver.outputs.tag }}"
4647
git push origin "${{ steps.calver.outputs.tag }}"
48+
gh workflow run release.yml --ref main -f tag="${{ steps.calver.outputs.tag }}"

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ jobs:
5050
needs: [test, worker]
5151
runs-on: macos-latest
5252
env:
53-
GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
53+
GH_TOKEN: ${{ github.token }}
5454
steps:
5555
- name: Checkout
5656
uses: actions/checkout@v4
5757
with:
5858
fetch-depth: 0
59-
token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
59+
token: ${{ github.token }}
6060

6161
- name: Setup Go
6262
uses: actions/setup-go@v5
@@ -113,6 +113,6 @@ jobs:
113113
version: latest
114114
args: release --clean --config /tmp/.goreleaser.yaml --release-notes /tmp/release-notes.md
115115
env:
116-
GITHUB_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
116+
GITHUB_TOKEN: ${{ github.token }}
117117
WK_CLIENT_ID: ${{ secrets.WK_CLIENT_ID }}
118118
WK_CLIENT_SECRET: ${{ secrets.WK_CLIENT_SECRET }}

0 commit comments

Comments
 (0)