Potential fix for code scanning alert no. 1: Workflow does not contain permissions - #3
Conversation
…n permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe CI workflow explicitly declares workflow-level permissions, granting the ChangesCI Workflow Permissions
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 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)
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 |
Potential fix for https://github.com/kjdev/php-ext-cedar/security/code-scanning/1
Add an explicit
permissionsblock at the workflow root in.github/workflows/ci.ymlso it applies to all jobs unless overridden.For this workflow, the minimal least-privilege setting is:
contents: readThis preserves current behavior (checkout can still read source), documents required access, and prevents accidental broader token scopes if repository/org defaults are permissive or later changed.
Edit location:
.github/workflows/ci.ymlpermissions:after theon:triggers block and beforejobs:.No imports, methods, or external definitions are needed.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.
Summary by CodeRabbit