Skip to content

Sync versioned branch rulesets as committed JSON#194

Closed
ptr727 wants to merge 1 commit into
developfrom
feature/sync-versioned-rulesets
Closed

Sync versioned branch rulesets as committed JSON#194
ptr727 wants to merge 1 commit into
developfrom
feature/sync-versioned-rulesets

Conversation

@ptr727

@ptr727 ptr727 commented Jun 26, 2026

Copy link
Copy Markdown
Owner

What

Adds the template's versioned branch rulesets as committed files:

  • .github/rulesets/develop.json
  • .github/rulesets/main.json

These carry the re-importable writable subset ({name, target, enforcement, bypass_actors, conditions, rules}) and port verbatim — conditions key on refs/heads/{develop,main}, bypass_actors uses the global Admin role actor_id: 5, the required check binds by name. strict_required_status_checks_policy is false on 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

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>
Copilot AI review requested due to automatic review settings June 26, 2026 16:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json capturing the writable subset of the main branch ruleset (required checks, merge method, signatures, Copilot review rule, etc.).
  • Add .github/rulesets/develop.json capturing the writable subset of the develop branch 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.

@ptr727

ptr727 commented Jun 26, 2026

Copy link
Copy Markdown
Owner Author

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).

@ptr727 ptr727 closed this Jun 26, 2026
@ptr727 ptr727 deleted the feature/sync-versioned-rulesets branch June 26, 2026 16:59
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.

2 participants