Skip to content

Restore NODE_AUTH_TOKEN for GitHub Packages publish#357

Merged
liuliu-dev merged 1 commit into
mainfrom
liuliu/github-token
Jun 9, 2026
Merged

Restore NODE_AUTH_TOKEN for GitHub Packages publish#357
liuliu-dev merged 1 commit into
mainfrom
liuliu/github-token

Conversation

@liuliu-dev

Copy link
Copy Markdown
Contributor

The publish-github job in publish.yml failed during the v5.1.0 release with 401 Unauthorized when pushing to npm.pkg.github.com:

npm error 401 Unauthorized - PUT https://npm.pkg.github.com/@github%2frelative-time-element - unauthenticated: User cannot be authenticated with the token provided.

This is a regression from a8c32fc, which added id-token: write to the GPR job and removed NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} from the publish step.

That change appears to mirror the OIDC trusted-publisher flow we use for npmjs.org, but npm.pkg.github.com still requires NODE_AUTH_TOKEN to authenticate the publish.

This PR restores NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} on the GPR publish step.

Copilot AI review requested due to automatic review settings June 9, 2026 16:28
@liuliu-dev liuliu-dev requested a review from a team as a code owner June 9, 2026 16:28
GitHub Advanced Security started work on behalf of liuliu-dev June 9, 2026 16:28 View session
GitHub Advanced Security finished work on behalf of liuliu-dev June 9, 2026 16:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a release regression in the GitHub Actions publish workflow by restoring authentication for publishing to GitHub Packages (npm.pkg.github.com) in the publish-github job.

Changes:

  • Re-adds NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} to the GitHub Packages npm publish step to prevent 401 Unauthorized failures.
Show a summary per file
File Description
.github/workflows/publish.yml Restores NODE_AUTH_TOKEN on the GitHub Packages publish step so npm publish can authenticate to npm.pkg.github.com.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@liuliu-dev liuliu-dev merged commit f344dea into main Jun 9, 2026
6 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.

3 participants