-
Notifications
You must be signed in to change notification settings - Fork 67
Configure trusted publishing #1427
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
base: main
Are you sure you want to change the base?
Conversation
|
|
Warning Rate limit exceeded@Strift has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 37 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThis is a configuration update to the GitHub Actions publish workflow. Single-quoted branch patterns are converted to double-quoted strings, a permissions block is added at the top level granting id-token write and contents read access, and the Node.js version string is normalized to double quotes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/publish.yml(2 hunks)
🔇 Additional comments (1)
.github/workflows/publish.yml (1)
7-9: Quote normalization is safe.Converting single to double quotes in YAML branch patterns and the node-version string is a stylistic consistency improvement with no functional impact.
Also applies to: 25-25
| permissions: | ||
| id-token: write # Required for OIDC | ||
| contents: read |
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.
🧩 Analysis chain
🌐 Web query:
changesets/action OIDC trusted publishing npm support
💡 Result:
Short answer: changesets/action does not yet support npm Trusted Publishing / OIDC. The action still expects an NPM_TOKEN (secret) for publishing; there is an open feature request to add Trusted‑Publishing / OIDC support. [1][2][3]
What to do now (concise):
- Use a separate publish job that uses npm's Trusted Publishing (OIDC) flow (give workflow permission id-token: write and run npm@>=11.5.1 or an action that supports OIDC). Example actions and docs show using OIDC instead of a stored NPM_TOKEN. [3][4]
Sources:
- changesets/action README (publishing uses NPM_TOKEN secret). [1]
- changesets/action issues — open feature request “Support Trusted Publishing”. [2]
- npm Trusted Publishing / OIDC docs (how to configure OIDC publish and required workflow permissions). [3]
- Example npm-publish action docs showing OIDC/trusted-publishing usage (omit token when trusted publishing is configured). [4]
OIDC permissions are correctly scoped, but the workflow cannot currently use them.
The permissions block properly enables OIDC token generation with id-token: write and restricts repository access with contents: read. However, changesets/action@v1 does not yet support npm Trusted Publishing / OIDC—it still requires NPM_TOKEN secrets. The permissions alone will not enable OIDC in this workflow.
The workflow should either:
- Await OIDC support in changesets/action (open feature request), or
- Replace the changesets/action publish step with a separate job using an OIDC-compatible action (e.g., npm@>=11.5.1 or a dedicated npm-publish action that supports Trusted Publishing).
Currently, the NPM_TOKEN secrets (lines 11, 36, 44) remain the only authentication mechanism for publishing.
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.
@Strift can you check what we can do with changeset please? 😊
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.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
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.
@coderabbitai review the changes to workflow structure
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.
@Strift, here's my review of the workflow structure changes:
Workflow Structure Analysis
✅ Good Structural Elements
-
Clear Job Separation: The workflow maintains two distinct jobs with well-defined responsibilities:
version-packages: Handles versioning using changesets (Node 18.x)publish-packages: Handles building and publishing (Node 24.x)
-
Permissions Block: The new top-level
permissionsblock is correctly positioned and scoped:id-token: writeenables OIDC token generationcontents: readprovides minimal repository access- Applies to both jobs in the workflow
-
Branch Triggers: Double-quoted branch patterns maintain the same filtering logic (main, pre-release-beta, beta, prototype-beta)
⚠️ Structural Concerns
-
No Job Dependencies: The two jobs appear to run in parallel with no explicit ordering. Consider if
publish-packagesshould depend onversion-packages:publish-packages: needs: version-packages name: Publish Packages
-
Missing OIDC Configuration: While the permissions enable OIDC token generation, the workflow lacks the configuration to actually use it:
- No
.npmrcsetup for provenance - No
--provenanceflag in the publish command - Still relies on
NODE_AUTH_TOKENfrom secrets (line 11) - The
yarn releasecommand needs to be configured to use OIDC instead of the token
- No
-
Incomplete OIDC Migration: The workflow appears to be in a hybrid state:
- OIDC permissions are enabled
- But traditional NPM_TOKEN authentication is still configured
- The publishing mechanism may not actually use the OIDC token
💡 Recommendations
To complete the OIDC/trusted publishing migration:
-
Configure npm for provenance in the publish job:
- name: Setup .npmrc for provenance run: | echo "provenance=true" >> .npmrc
-
Verify
yarn releaseis configured to use npm >= 11.5.1 or properly configured for OIDC -
Consider removing
NODE_AUTH_TOKENonce OIDC is fully configured (npm will automatically use OIDC tokens when available) -
Add job dependencies if versioning should complete before publishing
The structural foundation for OIDC is in place, but the workflow needs additional configuration to actually leverage trusted publishing.
flevi29
left a 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.
According to the AI this might not work, but I'll approve it for now.
- Split the workflow into two jobs: 'version-packages' and 'publish-packages'. - Updated Node.js version for the publish job to 24.x. - Removed unnecessary environment variables and steps related to npm authentication. - Adjusted the 'Create Release Pull Request' step to not publish automatically.
0277c6f to
a43c11f
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Pull Request
What does this PR do?
publish.ymlworkflow to allow generating OIDC tokensPR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!
Summary by CodeRabbit
Note: This release contains no changes visible to end-users. Updates were made to internal infrastructure only.
✏️ Tip: You can customize this high-level summary in your review settings.