Include main branch ruleset as part of the template#40
Open
d-morrison wants to merge 3 commits into
Open
Conversation
Adapted from d-morrison/rpt#134. Exports the live `main` ruleset to .github/rulesets/main.json with the server-assigned fields stripped, adds apply-rulesets.sh that PUTs to update / POSTs to create (idempotent), and documents what's enforced in .github/rulesets/README.md. README.Rmd / README.md get a step pointing to the script under "Setup steps". qbt-specific ruleset: required PR + required status checks (link-checker, Spellcheck, check-chars, build-deploy; non-strict) + no force-push / no deletion, Maintain-role PR-only bypass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The check-links.yml workflow declares `pull_request` as a trigger but doesn't actually produce a check run on PR events in this repo (workflow run history shows only `schedule` events firing it). Requiring it as a status check would make every PR wait forever for a context that never arrives. The live ruleset on the canonical qbt repo currently has the same gap; this commit removes it from the JSON shipped with the template so that new repos derived from the template don't inherit a broken gate. Apply the change to the live repo by running `.github/scripts/apply-rulesets.sh`. Also clarify in the rulesets README that the `build-deploy` PR check is satisfied by `preview.yml` (publish.yml is push-only), so future renames don't silently break the ruleset gate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The "Apply branch rulesets" step described the required-checks list as (link-checker, Spellcheck, check-chars, build-deploy). link-checker was removed from main.json in the previous commit; update the README to match so the docs and the actual ruleset don't disagree. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapted from d-morrison/rpt#134.
Summary
mainbranch ruleset to.github/rulesets/main.json(server-assigned fields stripped so it round-trips through the create/update endpoints)..github/scripts/apply-rulesets.shidempotently applies every JSON in.github/rulesets/to the current repo — PUT to update an existing ruleset by name, POST to create..github/rulesets/README.mddocuments what's enforced (required PR, required status checks for link-checker / Spellcheck / check-chars / build-deploy, no force-push / no deletion, Maintain-role PR-only bypass) and how to re-export after editing in the UI.README.Rmd/README.md: add a one-step entry under "Setup steps" pointing to the script.Test plan
.github/scripts/apply-rulesets.shagainst it — verify the ruleset shows up under Settings → Rules → Rulesets with all required status checks listed..github/rulesets/main.json, run the script, confirm the change appears in the GitHub UI.🤖 Generated with Claude Code