Skip to content
Latchkey

semantic-release "ENOGHTOKEN No GitHub token specified"

semantic-release reads GH_TOKEN or GITHUB_TOKEN from the environment to publish a GitHub release. Without either, it aborts with ENOGHTOKEN before touching the repo.

What this error means

semantic-release fails early with "EGHNOPERMISSION" or "ENOGHTOKEN No GitHub token specified".

github-actions
[semantic-release] ENOGHTOKEN No GitHub token specified.
A GitHub token must be created and set in the GH_TOKEN or GITHUB_TOKEN environment variable.

Common causes

Token not passed as env

semantic-release reads the token from env, not from a with: input, so it must be set under env.

Insufficient token scope

A token without contents/issues write cannot create the release or comment on PRs.

How to fix it

Expose GITHUB_TOKEN in the step env

  1. Set GITHUB_TOKEN under env on the semantic-release step.
  2. Grant contents: write and issues: write at the workflow level.
  3. Re-run the release.
.github/workflows/release.yml
permissions:
  contents: write
  issues: write
  pull-requests: write
steps:
  - run: npx semantic-release
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

How to prevent it

  • Pass tokens to CLI-based release tools via env, not with: inputs.
  • Grant the minimal write scopes semantic-release plugins require.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →