Skip to content

Fix publish workflow: add NODE_AUTH_TOKEN and --provenance flag#1

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/debug-publish-actions
Draft

Fix publish workflow: add NODE_AUTH_TOKEN and --provenance flag#1
Copilot wants to merge 2 commits intomainfrom
copilot/debug-publish-actions

Conversation

Copy link

Copilot AI commented Mar 10, 2026

All non-dry-run publish workflow runs fail because the npm publish step never sets NODE_AUTH_TOKEN. The actions/setup-node with registry-url creates an .npmrc referencing ${NODE_AUTH_TOKEN}, but nothing populates it.

  • Add NODE_AUTH_TOKEN env var from secrets.NPM_TOKEN to the publish step
  • Add --provenance flag — the workflow already declares id-token: write but never uses it
- name: Publish to npm
  if: ${{ !inputs.dry_run }}
  run: npm publish --access public --provenance
  env:
    NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Note: The NPM_TOKEN repository secret must be an npm automation token, not a "publish" token (which requires OTP and will always fail in CI — this was the EOTP error seen in earlier runs).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

The npm publish step was missing the NODE_AUTH_TOKEN environment variable
needed to authenticate with the npm registry. The actions/setup-node action
creates an .npmrc that references NODE_AUTH_TOKEN, but the publish step
never set it from secrets.

Also added --provenance flag since the workflow already has id-token: write
permission configured for npm provenance support.

Co-authored-by: CameronTofer <3507892+CameronTofer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix publish actions failing issues Fix publish workflow: add NODE_AUTH_TOKEN and --provenance flag Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants