Skip to content

Commit d1d3180

Browse files
authored
Fix goreleaser failure: use github.token and add replace_existing_draft
The goreleaser workflow was failing with: PATCH .../releases/343427697: 404 Not Found Root cause: The GORELEASER_GITHUB_TOKEN lacks write permission to update releases in auth0/auth0-cli (GitHub returns 404 instead of 403 for security). This manifests when a release is pre-created before goreleaser runs. Fix: - Use github.token (has contents:write from workflow permissions) for goreleaser's GITHUB_TOKEN so it always has permission to create and update releases in auth0/auth0-cli - Add release.replace_existing_draft: true to .goreleaser.yml to handle stale draft releases from previous failed attempts The downstream homebrew/scoop steps use explicit token: parameters (not the GITHUB_TOKEN env var), so they are unaffected by this change.
1 parent 4d9f0bd commit d1d3180

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
args: release --clean
3232
workdir: 'auth0-cli'
3333
env:
34-
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
34+
GITHUB_TOKEN: ${{ github.token }}
3535
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
3636

3737
# Homebrew Tap Process

.goreleaser.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ snapshot:
3232
version_template: "{{ .Tag }}-SNAPSHOT-{{.ShortCommit}}"
3333
changelog:
3434
disable: true
35+
release:
36+
replace_existing_draft: true
3537
brews:
3638
- name: auth0
3739
repository:

0 commit comments

Comments
 (0)