feat: check actions PR settings in repo maintenance - #867
Conversation
|
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 (3)
📝 WalkthroughWalkthroughAdds a ChangesGitHub Actions PR Settings Check
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
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 docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
test/repo-maintenance-actions-settings.test.jsOops! Something went wrong! :( ESLint: 10.5.0 ReferenceError: describe is not defined 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2d11fb8cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| can_create_pr="$(echo "$settings" | jq -r '.can_approve_pull_request_reviews // false')" | ||
| settings_url="https://github.com/$repo/settings/actions" | ||
|
|
||
| if [[ "$default_permissions" != "write" ]]; then |
There was a problem hiding this comment.
Do not require write-all default workflow permissions
When a repo keeps the default GITHUB_TOKEN setting at read-only but grants contents: write/pull-requests: write on the specific PR-creating jobs, this check fails even though PR creation is configured correctly; GitHub documents that the workflow/job permissions key modifies the token for that job (https://docs.github.com/en/actions/tutorials/authenticate-with-github_token#modifying-the-permissions-for-the-github_token), and this repo already does that in .github/workflows/update-libraries.yml:23-25, .github/workflows/scheduled-maintenance.yml:31-33, and .github/workflows/claude.yml:51-53. Requiring the repo-wide default to be write makes --check-actions-pr-settings reject the safer read-only-default configuration and tells maintainers to broaden every workflow unnecessarily.
Useful? React with 👍 / 👎.
|
🎉 This PR is included in version 1.119.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
--check-actions-pr-settingsfor targeted verification.ghCLI for allowed and blocked repository settings.Verification
npm run format:checknpm run lintnpm testnpm run shellcheckbash script/repo-maintenance.sh --check-actions-pr-settingsSummary by CodeRabbit
New Features
Documentation
Tests