| file_type | documentation | ||||
|---|---|---|---|---|---|
| title | GitHub Branch Rulesets Configuration | ||||
| description | Overview and instructions for importing/updating the repository branch rulesets. | ||||
| last_updated | 2026-06-18 | ||||
| owners |
|
||||
| version | v1.1 | ||||
| status | active | ||||
| stability | stable | ||||
| domain | governance | ||||
| tags |
|
||||
| language | en |
This directory contains version-controlled JSON definitions of the GitHub repository rulesets applied to the main protected branches: main and develop.
1. develop Branch Ruleset (develop.ruleset.json)
-
Target Ref:
refs/heads/develop -
Enforcement: Active
-
Key Rules:
- Deletion blocked
- Non-fast-forward merges (force pushes) blocked
- Pull request required before merging (1 approval, dismiss stale approvals, resolve conversations, respect Code Owners)
- Required status checks (live check-run names, verified 2026-09-22):
Route PR template and apply labelsValidate changelog on PRactionlint
-
Not enforced: no merge-queue rule — the repo merges directly and via Mergify, not the GitHub merge queue.
-
Bypass: one actor, the repository owner
eleshar(User1577675), inpull_requestmode: the owner can merge a pull request past the review requirement, and cannot push todevelopdirectly. Any other bypass actor, or a different mode for this one, is reported as drift byvalidate-ruleset-drift, but only when the script can see the actors. GitHub returnsbypass_actorsonly to a caller with write access to the ruleset, so CI (which deliberately holds no such credential) notes that they were not compared. An owner verifies them by running the check with their own token, for example after any ruleset change:GITHUB_TOKEN=$(gh auth token) GITHUB_REPOSITORY=lightspeedwp/.github \ node scripts/validation/validate-ruleset-drift.cjs
2. main Branch Ruleset (main.ruleset.json)
- Target Ref:
refs/heads/main - Enforcement: Active in JSON — not yet applied (needs explicit go-ahead before enforcing on
main) - Key Rules:
- Deletion blocked
- Non-fast-forward merges (force pushes) blocked
- Pull request required before merging (1 approval, dismiss stale approvals, resolve conversations, respect Code Owners)
- Required status checks (live check-run names, verified 2026-09-22):
Route PR template and apply labelsValidate branch nameactionlint
- No
validate-release-branchcheck exists; the changelog gate only targets develop PRs, so it is intentionally excluded here.
- Not enforced: no merge-queue rule — the repo merges directly and via Mergify, not the GitHub merge queue.
Since GitHub rulesets are configured via the GitHub platform settings, these JSON files serve as version-controlled declarations.
To apply or update rulesets:
- Navigating to the repository settings page on GitHub.
- Select Rules -> Rulesets from the sidebar.
- Import the ruleset definition using these JSON files, or configure them to match.
flowchart TD
accTitle: flowchart diagram
accDescr: flowchart flowchart
A[Start Here] --> B[Read Scope and Prerequisites]
B --> C[Run the Documented Workflow]
C --> D[Validate with Repo Tooling]
D --> E[Open PR or Hand-off]
classDef start fill:#E8F5E9,stroke:#2E7D32,stroke-width:2px,color:#1B5E20;
classDef prep fill:#E3F2FD,stroke:#1565C0,stroke-width:2px,color:#0D47A1;
classDef run fill:#fef3c7,stroke:#b45309,stroke-width:2px,color:#4a2c00;
classDef gate fill:#f3e8ff,stroke:#7e22ce,stroke-width:2px,color:#3b0764;
classDef done fill:#E0F2F1,stroke:#00695C,stroke-width:2px,color:#004D40;
class A start;
class B prep;
class C run;
class D gate;
class E done;