ncipollo/release-action "missing token" / 401 on release create
By Kaveh Alemi·Latchkey
ncipollo/release-action needs a token to call the releases API. When none is passed and the environment has none, the action errors before contacting GitHub.
What this error means
A release step using ncipollo/release-action fails with "missing token" or a 401 from the API.
Permission failures in Actions are almost never about your repository settings alone. Three things combine: the default GITHUB_TOKEN permission set for the repo or organization, the permissions: block in the workflow, and whether the event is a fork pull request, which downgrades the token to read-only regardless of everything else.
Declaring a permissions: block switches the job from the repository default to exactly what you list, so an incomplete block is a common cause of a new failure right after someone tightened security. List every scope the job needs, not just the one that failed.
.github/workflows/ci.yml
permissions:contents:read # checkoutpackages:write # push to GHCRid-token:write # OIDC to a cloud providerpull-requests:write # comment on or label a PRchecks:write # publish check runs
How to prevent it
Always pass token explicitly to release actions; defaults vary by action version.
Use GITHUB_TOKEN over a PAT unless cross-repo release is required.
Frequently asked questions
What causes ncipollo/release-action "missing token" / 401 on release create?
There are 2 common causes: no token input and no env token and token expired on a long job. The action could not find a token via the token input or GITHUB_TOKEN in the environment.
How do I fix ncipollo/release-action "missing token" / 401 on release create?
Pass the GITHUB_TOKEN to the action. Set the token input to secrets.GITHUB_TOKEN.
What does ncipollo/release-action "missing token" / 401 on release create actually mean?
A release step using ncipollo/release-action fails with "missing token" or a 401 from the API.
How do I stop ncipollo/release-action "missing token" / 401 on release create happening again?
Always pass token explicitly to release actions; defaults vary by action version. The prevention section lists 2 changes that keep it from recurring.