GoReleaser publish 403 Forbidden (token scope) in CI
A 403 during publish means GoReleaser is authenticated but the token is not permitted to perform the action, such as uploading release assets or writing to the repository. The credential is valid; its scope is not.
What this error means
GoReleaser fails mid-publish with "403 Forbidden" or "Resource not accessible by integration" while creating the release or uploading an artifact.
⨯ release failed after 4s
error=failed to upload dist/app_linux_amd64.tar.gz: PUT ...: 403 Forbidden
{Message:Resource not accessible by integration}Common causes
The workflow token is read-only
Without permissions: contents: write, the built-in GITHUB_TOKEN cannot create releases or upload assets, returning 403.
The PAT lacks the required scope
A personal access token missing repo (or fine-grained contents write) scope authenticates but is forbidden from writing.
How to fix it
Grant contents write to the job
Add the write permission so the default token can publish.
permissions:
contents: writeScope the PAT for external targets
- Create a PAT with
reposcope (or fine-grained contents write on the target repos). - Store it as a secret and pass it as
GITHUB_TOKENto GoReleaser. - Re-run the publish step.
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_PAT }}How to prevent it
- Grant least-privilege
contents: writefor standard releases. - Use a scoped PAT for tap, formula, or bucket repos in other orgs.
- Audit token scopes when publish targets change.