-
Notifications
You must be signed in to change notification settings - Fork 0
🔧 [PB-1278] Switch to traditional npm token authentication #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
After 4 failed attempts with OIDC trusted publishing (#20, #21, #22, #23), we're switching to the more reliable traditional npm token authentication. Changes: - Add registry-url back to setup-node - Add NODE_AUTH_TOKEN env using NPM_TOKEN secret - Bump version to 0.2.12 - Keep --provenance flag for supply chain security Required setup: 1. Create npm automation token at https://www.npmjs.com/settings/[username]/tokens/create 2. Add as GitHub secret: NPM_TOKEN Benefits: ✅ Battle-tested and reliable ✅ Still supports provenance attestation ✅ No OIDC configuration issues Trade-offs:⚠️ Requires manual token management⚠️ Token needs rotation
📝 WalkthroughWalkthroughUpdated CI deploy workflow to specify the npm registry URL and provide an auth token for publishing; package version bumped from 0.2.11 to 0.2.12. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 PR Quality Check Summary
📋 Checks Performed:
🎉 All checks passed! This PR is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/deploy.yml:
- Line 79: The publish step currently uses the `--provenance` flag in the
command string `npm publish --access public --tag ${{ steps.version.outputs.tag
}} --provenance`; remove the `--provenance` flag so the publish runs with
`NODE_AUTH_TOKEN` token-based auth (i.e., change the run command to omit
`--provenance`) to avoid OIDC/provenance conflicts that cause the publish to
fail.
🧹 Nitpick comments (1)
.github/workflows/deploy.yml (1)
11-11: Consider removing theid-token: writepermission.The
id-token: writepermission was required for OIDC-based publishing but is no longer needed with traditional npm token authentication. Keeping it doesn't cause harm but removes unnecessary permissions following the principle of least privilege.🧹 Proposed cleanup
permissions: - id-token: write contents: write
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/deploy.ymlpackage.json
🔇 Additional comments (3)
package.json (1)
3-3: LGTM! Version bump is correct.The patch version increment to 0.2.12 follows semantic versioning appropriately for this workflow configuration change.
.github/workflows/deploy.yml (2)
63-63: LGTM! Registry URL correctly configured.The npm registry URL is properly specified for traditional token authentication.
80-81: Configuration is correct—verify NPM_TOKEN secret exists before deployment.The
NODE_AUTH_TOKENenvironment variable is properly configured for npm authentication. The setup-node action (line 59–63) withregistry-url: 'https://registry.npmjs.org'creates the necessary .npmrc that respects this token, which matches npm and GitHub Actions documentation.Before this workflow is deployed, ensure the
NPM_TOKENsecret has been created at the repository level with a valid npm automation token.
🔍 PR Quality Check Summary
📋 Checks Performed:
🎉 All checks passed! This PR is ready for review. |
Summary
After 4 failed attempts with OIDC trusted publishing (#20, #21, #22, #23), we're switching to the reliable traditional npm token authentication method.
What Happened with OIDC
Despite correct configuration, OIDC consistently failed:
404 Not Foundwith provenance success404 Not Foundwith provenance success404 Not Foundwith provenance success (removed NODE_AUTH_TOKEN)ENEEDAUTHerror (removed registry-url)Configuration was verified correct:
New Approach: Traditional npm Token
This PR implements the proven traditional authentication method.
Changes
registry-url: 'https://registry.npmjs.org'back to setup-nodeNODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}to publish step--provenanceflag for supply chain securityRequired Setup (Action Needed!)
Before merging, you need to create the
NPM_TOKENsecret:Create npm automation token:
@ubidots/react-html-canvasAdd GitHub secret:
NPM_TOKENBenefits
--provenanceflagTrade-offs
Testing Plan
Once
NPM_TOKENsecret is configured:Status: ⏸️ Waiting for
NPM_TOKENsecret to be configured before mergingSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.