- Notifications
You must be signed in to change notification settings - Fork 30
Potential fix for code scanning alert no. 3: Workflow does not contain permissions #206
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
…n permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
WalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 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 ( |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (70.66%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@ ## main #206 +/- ## ======================================= Coverage 70.66% 70.66% ======================================= Files 134 134 Lines 10866 10866 ======================================= Hits 7679 7679 Misses 3187 3187 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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: 0
🧹 Nitpick comments (1)
.github/workflows/main.yaml (1)
97-99
: Principle-of-Least-Privilege looks good; consider a default blanket restrictionAdding
permissions: contents: write
at job scope resolves the code-scanning alert and is the minimal scope required by the release action.
For extra hardening you could also set a workflow-level default such aspermissions: {}or, if read access is still needed elsewhere,
permissions: contents: readand continue to override per-job as done here. This prevents any future job from silently inheriting broader token rights.
No action is strictly required for this PR, but the tweak keeps the workflow aligned with GitHub’s security guidance.
Potential fix for https://github.com/openfga/python-sdk/security/code-scanning/3
To fix the problem, add an explicit
permissions
block to thecreate-release
job in.github/workflows/main.yaml
. This block should grant only the minimal permissions required for the job to function. Since the job creates a GitHub release, it requirescontents: write
permission. The block should be added directly under thecreate-release:
job definition, before thesteps:
key. No other changes are needed.Suggested fixes powered by Copilot Autofix. Review carefully before merging.
Summary by CodeRabbit