Skip to content

Fix ENEEDAUTH in publish workflow caused by empty NODE_AUTH_TOKEN override - #3

Merged
ademar merged 2 commits into
mainfrom
copilot/fix-publish-job-failure-again
Jun 16, 2026
Merged

Fix ENEEDAUTH in publish workflow caused by empty NODE_AUTH_TOKEN override#3
ademar merged 2 commits into
mainfrom
copilot/fix-publish-job-failure-again

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown

actions/setup-node@v4 with registry-url exports NODE_AUTH_TOKEN to $GITHUB_ENV (defaulting to github.token). The npm publish step's own env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} was overriding that with an empty string — step-level env: takes precedence over $GITHUB_ENV — because NPM_TOKEN was not set in the npm-publish environment. Result: blank auth token → ENEEDAUTH.

Changes

  • .github/workflows/publish.yml — pass token: ${{ secrets.NPM_TOKEN }} to setup-node@v4 (the idiomatic path: the action exports the token to $GITHUB_ENV itself) and remove the now-redundant — and dangerous — step-level env: NODE_AUTH_TOKEN blocks from both publish steps:

    - uses: actions/setup-node@v4
      with:
        node-version: '22'
        registry-url: 'https://registry.npmjs.org'
        scope: '@open-pulseboard'
        cache: npm
    +   token: ${{ secrets.NPM_TOKEN }}
    
    - name: npm publish
      if: ${{ ... }}
    - env:
    -   NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
      run: npm publish --access public --provenance
  • package.json — normalize repository.url to git+https:// prefix to eliminate the npm publish warning about auto-correction.

NPM_TOKEN must be configured in the npm-publish GitHub environment for the publish to succeed.

Copilot AI changed the title [WIP] Fix failing GitHub Actions job publish Fix ENEEDAUTH in publish workflow caused by empty NODE_AUTH_TOKEN override Jun 16, 2026
Copilot AI requested a review from ademar June 16, 2026 23:33
@ademar
ademar marked this pull request as ready for review June 16, 2026 23:36
@ademar
ademar merged commit f321cd4 into main Jun 16, 2026
3 checks passed
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