fix: enable delete_branch_on_merge and add settings enforcement script#104
fix: enable delete_branch_on_merge and add settings enforcement script#104
Conversation
Closes #90 Adds .github/scripts/apply-repo-settings.sh — an idempotent script that applies all required repository settings from the org standard: https://github.com/petry-projects/.github/blob/main/standards/github-settings.md Settings enforced: - delete_branch_on_merge: true (compliance fix for #90) - allow_auto_merge: true - allow_squash_merge / merge_commit / rebase_merge: true - has_issues: true, has_wiki: false - squash_merge_commit_title: PR_TITLE - squash_merge_commit_message: COMMIT_MESSAGES Also applied delete_branch_on_merge: true directly via GitHub API so the next compliance audit run will see the correct value without waiting for the script to be executed manually. Co-authored-by: don-petry <don-petry@users.noreply.github.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 44 minutes and 8 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
|
Hey @don-petry — this PR is ready for review and merge. It fixes the compliance finding by explicitly enabling |
|
There was a problem hiding this comment.
Pull request overview
This PR addresses org compliance for GitHub repository settings by adding a repo-local enforcement script intended to keep the petry-projects/markets repository aligned with the org’s standard defaults (including delete_branch_on_merge: true).
Changes:
- Added an idempotent
.github/scripts/apply-repo-settings.shscript that PATCHes the repository settings viagh api. - Script prints a focused subset of resulting repository settings for quick verification after applying changes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| has_wiki, | ||
| squash_merge_commit_title, | ||
| squash_merge_commit_message | ||
| }' | jq . |
There was a problem hiding this comment.
The gh api call already filters the response with --jq, but the additional | jq . introduces a hard dependency on an external jq binary and (because of set -o pipefail) can cause the script to exit non‑zero after successfully applying settings if jq isn’t installed. Consider dropping the pipe to jq, or making pretty-printing optional (e.g., only pipe when jq is available).
| }' | jq . | |
| }' |
Automated review — APPROVEDRisk: MEDIUM
SummaryPR #104 adds a manual idempotent bash script to enforce GitHub repository settings (fixing compliance issue #90). The script requires a human to supply an admin GH_TOKEN at runtime — no secrets are hardcoded, no CI automation is introduced, and all security scanners (CodeQL, SonarCloud, AgentShield) passed clean. Risk is MEDIUM solely because the script exercises GitHub administration scope, but the implementation is sound. FindingsInfo
CI statusAll automated checks passed (ci-green, CodeQL clean, SonarCloud zero issues). Merge is currently Reviewed by the don-petry PR-review cascade (triage: haiku 4.5 → deep: sonnet 4.6 + duck: gpt-5.4 → audit: opus 4.6). Reply with |
Adds `.github/scripts/apply-repo-settings.sh` — an idempotent script that applies all repository settings required by the org standard: https://github.com/petry-projects/.github/blob/main/standards/github-settings.md Settings enforced: - delete_branch_on_merge: true (compliance finding #90) - allow_auto_merge: true - allow_squash_merge / allow_merge_commit / allow_rebase_merge: true - has_issues: true, has_wiki: false - squash_merge_commit_title: PR_TITLE - squash_merge_commit_message: COMMIT_MESSAGES The setting has also been applied directly via the GitHub API this run. Supersedes PRs #104 and #118 (same intent, never merged). Closes #90 Co-authored-by: don-petry <don-petry@users.noreply.github.com>



Summary
delete_branch_on_merge: truedirectly to the repository via GitHub API to resolve the compliance finding.github/scripts/apply-repo-settings.sh— an idempotent script that enforces all required repository settings from the org standardSettings enforced by the script
delete_branch_on_mergetrueallow_auto_mergetrueallow_squash_mergetrueallow_merge_committrueallow_rebase_mergetruehas_issuestruehas_wikifalsesquash_merge_commit_titlePR_TITLEsquash_merge_commit_messageCOMMIT_MESSAGESTest plan
delete_branch_on_merge: trueconfirmed viagh api repos/petry-projects/markets --jq .delete_branch_on_merge.github/scripts/apply-repo-settings.shwith an admin token to verify idempotencyCloses #90
Generated with Claude Code