Repository rules
Branches, pull requests, the changelog and the scripts that enforce them.
These rules apply to everyone who changes the Cardinal repo, people and agents alike.
Branches
| Branch | Holds |
|---|---|
main | Integrated development work |
staging | What runs on the staging environment |
production | What runs in production |
Nobody commits or pushes to these three directly. They change only through a pull request, merged as a merge commit or a rebase merge.
feature branch → main → staging → productionMake a change
Branch off the target: git switch -c feat/short-name main.
Commit, and add an entry under ## [Unreleased] in CHANGELOG.md, in Added, Changed, Fixed or Removed.
Push and open a pull request into main.
Merge once the changelog check passes. The rust, elixir, frontend, docs and e2e jobs run only on pull requests into staging and production, so a promotion merges only when they pass.
Every pull request into a protected branch must change CHANGELOG.md. A promotion pull request passes as long as the promoted commits carry changelog entries.
Enforcement
| Layer | Does | Set up with |
|---|---|---|
| Git hooks | Refuse commits, local merge commits and pushes on the three branches | scripts/setup-hooks.sh, once per clone |
| GitHub Actions | changelog.yml fails a pull request that does not touch CHANGELOG.md. ci.yml builds and tests | Nothing |
| Branch protection | Requires a pull request and the checks, applies to admins, blocks force pushes and deletion | scripts/protect-branches.sh, by a repo admin with gh |
git commit --no-verify skips the hooks. Branch protection on GitHub is what enforces the rules. On a private repo it needs a paid GitHub plan.
Licence
Cardinal is proprietary. Package manifests must not declare an open-source licence or allow publishing:
| Manifest | Required |
|---|---|
Cargo.toml | publish = false, license-file = "LICENSE" |
package.json | "private": true, "license": "UNLICENSED" |
mix.exs | No Hex package block |
A third-party dependency must have a licence that allows use in closed-source commercial software.
See Releases for cutting a version.