Skip to content

feat: support GitHub rulesets for branch protection rules#23

Merged
packet-mover merged 1 commit intomainfrom
feat/support-rulesets
Apr 6, 2026
Merged

feat: support GitHub rulesets for branch protection rules#23
packet-mover merged 1 commit intomainfrom
feat/support-rulesets

Conversation

@packet-mover
Copy link
Copy Markdown
Contributor

Summary

  • Add GetRulesets using GET /repos/{owner}/{repo}/rules/branches/{branch} - single API call for effective branch rules
  • Rulesets checked first; classic branch protection only as fallback when no rulesets exist
  • No merging of both sources - rulesets are authoritative when present
  • Repos using modern rulesets (like this one) now correctly pass branch protection rules

Test plan

  • go test ./... passes
  • Manual test: scanner repo now shows 8/11 passing (was 5/11 before rulesets support)

Check rulesets first via GET /repos/{owner}/{repo}/rules/branches/{branch}
(single API call). Fall back to classic branch protection only if no
rulesets are configured. No merging needed.
@packet-mover packet-mover merged commit f8041bf into main Apr 6, 2026
2 checks passed
@packet-mover packet-mover deleted the feat/support-rulesets branch April 6, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant