-
Notifications
You must be signed in to change notification settings - Fork 1
fix: give write permissions for gh action to create release #3
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
WalkthroughThe GitHub Actions workflow file for publishing the Node SDK was updated by removing the explicit Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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
🧹 Nitpick comments (1)
.github/workflows/publish-node-sdk.yml (1)
17-22: Optional: speed up builds by caching npm dependencies
npm cidownloads the full dependency graph on every run. Adding the built-inactions/setup-nodecache (oractions/cache) can shave minutes off the workflow.- uses: actions/setup-node@v4 with: node-version: "20" registry-url: "https://registry.npmjs.org" + cache: 'npm'Nice-to-have but not required for the fix.
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: |
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.
Missing contents: write permission – release creation will still fail
The previous permissions block was entirely removed. Omitting it doesn’t grant broader rights—the default for the GITHUB_TOKEN remains read-only, so softprops/action-gh-release won’t be able to create the release.
Add an explicit contents: write (optionally narrowed to just the job) instead of deleting the block.
publish:
runs-on: ubuntu-latest
+ permissions:
+ contents: writeWithout this change the workflow will continue to error out on the “Create GitHub Release” step.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: |
🤖 Prompt for AI Agents
In .github/workflows/publish-node-sdk.yml around lines 7 to 10, the permissions
block was removed, causing the GITHUB_TOKEN to have only read access by default.
This prevents the release creation step from succeeding. Add back a permissions
block with at least contents: write permission scoped to the job to allow the
release creation action to work properly.
Description
Type of Change
Summary by CodeRabbit