Skip to content

Include main branch ruleset as part of the template#40

Open
d-morrison wants to merge 3 commits into
mainfrom
claude/include-branch-ruleset
Open

Include main branch ruleset as part of the template#40
d-morrison wants to merge 3 commits into
mainfrom
claude/include-branch-ruleset

Conversation

@d-morrison
Copy link
Copy Markdown
Owner

Adapted from d-morrison/rpt#134.

Summary

  • Export the live main branch ruleset to .github/rulesets/main.json (server-assigned fields stripped so it round-trips through the create/update endpoints).
  • New .github/scripts/apply-rulesets.sh idempotently applies every JSON in .github/rulesets/ to the current repo — PUT to update an existing ruleset by name, POST to create.
  • New .github/rulesets/README.md documents 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

  • Create a throwaway repo from the template and run .github/scripts/apply-rulesets.sh against it — verify the ruleset shows up under Settings → Rules → Rulesets with all required status checks listed.
  • Re-run the script — confirm it updates in place rather than creating a duplicate.
  • Edit a rule in .github/rulesets/main.json, run the script, confirm the change appears in the GitHub UI.

🤖 Generated with Claude Code

d-morrison and others added 3 commits May 18, 2026 20:31
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>
@github-actions
Copy link
Copy Markdown

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://d-morrison.github.io/qbt/pr-preview/pr-40/

Built to branch gh-pages at 2026-05-19 08:02 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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