Sync versioned branch rulesets as committed JSON#194
Conversation
Adds .github/rulesets/{develop,main}.json (the writable subset of the two
branch rulesets) from the template, making rulesets versioned and
drift-checkable. Files only; live ruleset config is untouched.
Downstream half of ptr727/ProjectTemplate#211.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds committed JSON snapshots of the repository’s branch rulesets so they can be versioned, re-synced from the template, and drift-checked like other template-carried artifacts (without changing the live GitHub ruleset configuration in this PR).
Changes:
- Add
.github/rulesets/main.jsoncapturing the writable subset of themainbranch ruleset (required checks, merge method, signatures, Copilot review rule, etc.). - Add
.github/rulesets/develop.jsoncapturing the writable subset of thedevelopbranch ruleset (linear history + squash-only, required checks, signatures, Copilot review rule, etc.).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/rulesets/main.json | Adds the committed/exported main branch ruleset JSON for drift-checking and re-import. |
| .github/rulesets/develop.json | Adds the committed/exported develop branch ruleset JSON for drift-checking and re-import. |
|
Closing — decision reversed. The ruleset JSON will live only in the template (ptr727/ProjectTemplate) as the source of truth, used during porting/resync to import/diff a repo's live rulesets. Syncing the files into every downstream repo just adds noise and divergence with no benefit, since rulesets are live GitHub config, not a file the repo consumes. Drift reconciliation moves into the template's re-sync loop instead (ptr727/ProjectTemplate#211). |
What
Adds the template's versioned branch rulesets as committed files:
.github/rulesets/develop.json.github/rulesets/main.jsonThese carry the re-importable writable subset (
{name, target, enforcement, bypass_actors, conditions, rules}) and port verbatim —conditionskey onrefs/heads/{develop,main},bypass_actorsuses the global Admin roleactor_id: 5, the required check binds by name.strict_required_status_checks_policyisfalseon both branches.Why
Implements the downstream half of ptr727/ProjectTemplate#211. Branch rulesets were live GitHub config applied once at repo creation, so they sat outside the file-based re-sync loop: a corrected template ruleset never propagated here, and ruleset drift was invisible. Committing the canonical JSON makes the rulesets versioned, re-syncable, and drift-checkable.
This PR only lands the files (the source of truth). It does not modify this repo's live GitHub ruleset config — drift between these files and live config is reported to the maintainer separately and corrected via a full-payload PUT, never auto-applied. See the drift-check command and rationale in ptr727/ProjectTemplate
AGENTS.md"Staying in Sync".🤖 Generated with Claude Code