Publish npm package from auto release#2
Conversation
Run the same npm publish flow inside auto-release after creating a new version tag so main merges can release and publish in one workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe auto-release workflow adds job outputs ChangesAuto-release with npm publishing
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/auto-release.yml:
- Around line 100-111: The current check using npm view ("Skip already published
version" step, id: published) treats any npm view failure as "not published" and
may proceed to publish on transient registry/auth errors; change the script to
run npm view and capture its exit code and stderr (using name and version
variables), set skip=true only when npm view exits 0, set skip=false only when
npm view exits non-zero and stderr clearly indicates "404" / "Not Found" / E404
(package/version missing), and otherwise fail the step (exit 1) to abort the
release on registry lookup/auth errors rather than attempting publish; ensure
you still echo the correct "skip=true"/"skip=false" to $GITHUB_OUTPUT.
- Around line 69-74: The workflow currently uses actions/setup-node@v4 with the
unsupported input package-manager-cache: remove the package-manager-cache line
from the Setup Node.js step or upgrade the action to actions/setup-node@v5 (or a
v5+ pin) if you intend to control package-manager-cache; update the uses entry
(actions/setup-node@v4 → actions/setup-node@v5) when choosing the upgrade and
keep node-version: 24 and registry-url unchanged.
- Around line 64-73: Replace floating tags for GitHub Actions with immutable
SHAs: update the workflow steps named "Checkout" and "Setup Node.js" to use the
specific commit SHAs instead of actions/checkout@v4 and actions/setup-node@v4
(and do the same for the release-job checkout if present). Locate the steps by
the step names "Checkout" and "Setup Node.js" or the current "uses:
actions/checkout@v4" and "uses: actions/setup-node@v4" lines, fetch the
corresponding stable commit SHAs from each action's GitHub repository, and
substitute the `@v4` tags with those SHAs to pin the actions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e80878e3-62f2-4e23-919e-589fdd766c88
📒 Files selected for processing (1)
.github/workflows/auto-release.yml
|
Actionable comments posted: 0 |
Summary
auto-release.ymlafter a new version tag/release is createdpublish.ymlsteps instead of inventing a separate release pathValidation
npm run checkpublish.yml/auto-release.ymlpatterns in this workspaceSummary by CodeRabbit