chore: npm publish fix for github runner#320
Conversation
WalkthroughModified GitHub Actions workflow to run npm install command with elevated privileges by adding a sudo prefix to the global npm update step. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/main.yaml (1)
107-114:⚠️ Potential issue | 🟠 MajorPre-existing bug:
env.NODE_VERSIONis undefined — should beenv.TARGET_NODE_VERSION.Line 110 references
${{ env.NODE_VERSION }}but the workflow definesTARGET_NODE_VERSIONon line 13. This means the publish job'ssetup-nodestep receives an empty node version, which may cause it to fall back to a default or fail. This is not introduced by this PR but is in the same job being modified.Proposed fix
- name: Set up node uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: - node-version: ${{ env.NODE_VERSION }} + node-version: ${{ env.TARGET_NODE_VERSION }} registry-url: "https://registry.npmjs.org"
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #320 +/- ##
=======================================
Coverage 89.55% 89.55%
=======================================
Files 25 25
Lines 1475 1475
Branches 254 277 +23
=======================================
Hits 1321 1321
Misses 93 93
Partials 61 61 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the release workflow to run the “ensure latest npm is installed” step with elevated privileges during the publish job.
Changes:
- Switch
npm install -g npm@latesttosudo npm install -g npm@latestin the publish workflow step.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Raghd Hamzeh <[email protected]>
Description
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
mainSummary by CodeRabbit
Note: This release contains no user-facing changes.