-
Notifications
You must be signed in to change notification settings - Fork 193
feat: migrate npm publish workflows to OIDC trusted publisher #1271
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
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request modernizes GitHub Actions workflow files across multiple project templates. The changes add explicit permissions blocks (id-token: write and contents: read) to workflows, update Node.js from version 20.x to 22, and replace Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes ✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
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 |
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.
Pull request overview
This PR modernizes npm package publishing by migrating from token-based authentication to npm's OIDC-based trusted publisher, enhancing security and simplifying credential management. The changes update GitHub Actions workflows across multiple project templates to use the new authentication method.
Key changes:
- Implemented OIDC authentication by adding
id-token: writeandcontents: readpermissions - Upgraded Node.js version from 20.x to 22 (current LTS) across all workflows
- Replaced
npm installwithnpm cifor more deterministic builds and added--provenance --access publicflags to npm publish commands
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
templates/cli/.github/workflows/npm-publish.yml |
Updated CLI template workflow with OIDC permissions, Node.js 22, npm ci, provenance flags, and corrected spelling error |
templates/node/.github/workflows/publish.yml.twig |
Updated Node template workflow with OIDC permissions, Node.js 22, npm ci, and provenance flags |
templates/react-native/.github/workflows/publish.yml.twig |
Updated React Native template workflow with OIDC permissions, Node.js 22, npm ci, and provenance flags |
templates/web/.github/workflows/publish.yml.twig |
Updated Web template workflow with OIDC permissions, Node.js 22, npm ci, and provenance flags |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| types: [published] | ||
|
|
||
| permissions: | ||
| id-token: write |
Copilot
AI
Dec 24, 2025
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.
The indentation for 'id-token: write' is incorrect. It should be aligned with 'contents:' on line 9. The property should start at column 3 (2 spaces of indentation) to match the YAML structure for the permissions block.
| id-token: write | |
| id-token: write |
Summary
This PR updates the npm publish workflows to use npm's new OIDC-based trusted publisher instead of token-based authentication.
Changes
id-token: writeandcontents: readpermissions for OIDCnpm installtonpm cifor more reliable CI builds--provenance --access publicflags for trusted publishingNODE_AUTH_TOKENenvironment variable (no longer needed with OIDC)Files Modified
templates/cli/.github/workflows/npm-publish.ymltemplates/node/.github/workflows/publish.yml.twigtemplates/react-native/.github/workflows/publish.yml.twigtemplates/web/.github/workflows/publish.yml.twigNote
After merging, you'll need to configure each npm package on npmjs.com to trust the corresponding GitHub repository:
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.