Skip to content
Latchkey

ncipollo/release-action "missing token" / 401 on release create

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.

github-actions
Error: missing token
##[error]Error: missing token

Diagnose it: what token do you actually have?

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.

.github/workflows/ci.yml
- name: Show the token scopes actually granted
  run: |
    curl -sI -H "Authorization: Bearer $GITHUB_TOKEN" \
      https://api.github.com/ | grep -i "^x-oauth-scopes\|^x-accepted"
    echo "event: ${{ github.event_name }}"
    echo "fork PR: ${{ github.event.pull_request.head.repo.fork }}"
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Common causes

No token input and no env token

The action could not find a token via the token input or GITHUB_TOKEN in the environment.

Token expired on a long job

A custom PAT expired before the release step ran, surfacing as an auth failure.

How to fix it

Pass the GITHUB_TOKEN to the action

  1. Set the token input to secrets.GITHUB_TOKEN.
  2. Grant contents: write so the token can create releases.
  3. Re-run the workflow.
.github/workflows/release.yml
permissions:
  contents: write
steps:
  - uses: ncipollo/release-action@v1
    with:
      token: ${{ secrets.GITHUB_TOKEN }}
      tag: ${{ github.ref_name }}

Grant the narrowest permission that works

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        # checkout
  packages: write       # push to GHCR
  id-token: write       # OIDC to a cloud provider
  pull-requests: write  # comment on or label a PR
  checks: 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.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card