Skip to content

A GitHub or GitLab release needs a token

error: creating the GitHub release v1.4.0 needs GITHUB_TOKEN
hint: Set GITHUB_TOKEN to a token that can create releases, or take hosting out of [release] in axle.toml.

hosting under [release] asks axle release publish to create a GitHub or GitLab release for each tag, and that needs a token: GITHUB_TOKEN for GitHub, and GITLAB_TOKEN or CI_JOB_TOKEN for GitLab. None was set. The packages before it were already published.

Set the variable in the job that publishes. On GitHub Actions, give the job permissions: contents: write and pass GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} in its env. On GitLab CI, CI_JOB_TOKEN is there already. Then run axle release publish again; packages already published are skipped. If you don’t want hosting releases, take hosting out of [release].