Skip to content

fix: use github.token for goreleaser to resolve 404 on release PATCH#1561

Merged
developerkunal merged 2 commits into
mainfrom
copilot/fix-goreleaser-failure
Jun 23, 2026
Merged

fix: use github.token for goreleaser to resolve 404 on release PATCH#1561
developerkunal merged 2 commits into
mainfrom
copilot/fix-goreleaser-failure

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The goreleaser workflow was failing with PATCH .../releases/343427697: 404 Not Found because GORELEASER_GITHUB_TOKEN lacked write permission to update a release in auth0/auth0-cli that had been manually published before the workflow ran. GitHub returns 404 (not 403) when a token attempts an unauthorized write on a public repo.

Changes

  • .github/workflows/release.yml — Switch goreleaser step from GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} to GITHUB_TOKEN: ${{ github.token }}. The workflow already declares permissions: contents: write, so the built-in token is guaranteed to have release write access. Downstream homebrew/scoop steps use explicit token: parameters and are unaffected.

  • .goreleaser.yml — Add release.replace_existing_draft: true so goreleaser deletes and recreates any stale draft releases left by previous failed attempts rather than trying to PATCH them in place.

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.
Copilot AI changed the title [WIP] Fix failing GitHub Actions job goreleaser fix: use github.token for goreleaser to resolve 404 on release PATCH Jun 23, 2026
Copilot AI requested a review from developerkunal June 23, 2026 11:38
@developerkunal developerkunal marked this pull request as ready for review June 23, 2026 11:42
@developerkunal developerkunal requested a review from a team as a code owner June 23, 2026 11:42

@developerkunal developerkunal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@developerkunal developerkunal enabled auto-merge (squash) June 23, 2026 11:45
@developerkunal developerkunal merged commit a1f92c1 into main Jun 23, 2026
6 checks passed
@developerkunal developerkunal deleted the copilot/fix-goreleaser-failure branch June 23, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants