> ## Documentation Index
> Fetch the complete documentation index at: https://docs.theroyalglow.in/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Rulesets

> Exact branch protection policy and safe activation sequence.

The importable API payloads are in `.github/rulesets/`. The **dev** ruleset requires
reviewed pull requests. Environment rulesets permit fast-forward updates and
require CI, CodeQL, integration, and (for pprd/prod) load/security aggregate checks.
They forbid deletion and non-fast-forward updates and have no bypass actors.

The promotion workflow enforces dev → test → pprd → prod at one validated commit
SHA. It requires explicit production confirmation by katbose before updating prod.
Mergify manages PRs into dev; environment updates do not use Mergify queues or PRs.

## Safe activation order

<Warning>
  Do not activate the supplied Rulesets before every named external check has
  run at least once. Requiring a check that has never registered can block all
  merges.
</Warning>

1. Install the Mergify, Socket, and Codecov GitHub Apps for this repository.
2. Merge the workflow/configuration bootstrap to `prod` so Mergify can read
   `.mergify.yml` from the default branch.
3. Run CI, CodeQL, Codecov, Socket, and Mergify checks on a test PR.
4. Import the three JSON payloads in **Settings -> Rules -> Rulesets**.
5. Confirm each target branch and required check name, then activate the Rulesets.
6. Disable the old `protect main branch` Ruleset after the replacements are active.
7. Enable **Merge commits** and **Squash merging**, disable rebase merging, and
   leave GitHub native auto-merge and merge queue disabled. Keep automatic branch
   deletion disabled during bootstrap; persistent branches must never be deleted.

GitHub Actions contexts use the job name, such as `CI Success`, without the
workflow prefix displayed in parts of GitHub's UI. Verify names through the
check-runs API before activation. See [Mergify's GitHub Actions guidance](https://docs.mergify.com/integrations/gha/).

Use Ruleset evaluation mode first if it is available on the repository plan. Verify
one complete promotion before switching all policies to active enforcement.


## Related topics

- [Git Workflow](/content/docs/git-workflow.md)
- [Engineering Workflow](/engineering/index.md)
- [Background Jobs](/content/docs/background-jobs.md)
- [Pages & Routes](/content/docs/pages-and-routes.md)
- [Deployment](/content/docs/deployment.md)
