Org settings and rulesets
Intended state of GitHub settings for Nyuchi Web Services. The rulesets as files live in nyuchi/.github (github-rulesets/, settings/rulesets/, settings/apply.sh, settings/require-all-green.sh); this page is the procedure and the intent.
Most of what’s in this repo (community-health files, workflow templates, issue forms, Dependabot config) works at the content level — it ships code and markdown that GitHub applies as defaults.
But a significant part of our security and review posture lives in GitHub’s UI settings, not in any file. That configuration is easy to drift out of, and easy to forget when spinning up a new repo.
This document is the source of truth for the settings we intend to have in place. If the live GitHub configuration disagrees with this document, either:
- This document is wrong — update it. Or,
- GitHub configuration is wrong — fix it.
Audit this document against reality at least once a quarter.
Changes require the same review bar as other security-adjacent
files (see CODEOWNERS).
Organization-level settings
Section titled “Organization-level settings”Member privileges
Section titled “Member privileges”- Base repository permission: Read for all org members. Write / Admin is granted via team membership, not via base permission.
- Repository creation: Restricted to org owners and the
@nyuchi/maintainersteam. Prevents ad-hoc repo sprawl. - Repository forking: Allowed within the org; disallowed externally for private repos.
- Pages creation: Restricted to org owners.
- Two-factor authentication: Required for all members.
Security features (org-wide)
Section titled “Security features (org-wide)”Enable at Settings → Code security and analysis for the org, and let the settings propagate to new repos as defaults:
| Feature | State |
|---|---|
| Dependency graph | Enabled |
| Dependabot alerts | Enabled |
| Dependabot security updates | Enabled |
| Dependabot version updates | Opt-in per-repo via .github/dependabot.yml |
| Secret scanning | Enabled |
| Secret scanning — push protection | Enabled |
| Secret scanning — validity checks | Enabled |
| Secret scanning — non-provider patterns | Enabled (org-wide, not just public repos) |
| Private vulnerability reporting | Enabled |
| CodeQL default setup | Enabled per-repo (see below) |
Actions permissions
Section titled “Actions permissions”At Settings → Actions → General:
-
Allowed actions: Allow select actions and reusable workflows — do not allow all actions unrestricted.
-
Allow actions created by GitHub: Yes.
-
Allow actions by Marketplace verified creators: Yes.
-
Allow specified actions and reusable workflows: the allow-list below is the source of truth — every action used in
.github/workflows/reusable-*.ymlmust appear here. When adding a new action to any reusable workflow, update this list in the same PR.actions/*,github/codeql-action/*,anchore/sbom-action@*,softprops/action-gh-release@*,DavidAnson/markdownlint-cli2-action@*,amannn/action-semantic-pull-request@*,streetsidesoftware/cspell-action@*,lycheeverse/lychee-action@*,dorny/paths-filter@*,pnpm/action-setup@*,Swatinem/rust-cache@*,dtolnay/rust-toolchain@*,taiki-e/install-action@*,astral-sh/setup-uv@*,ossf/scorecard-action@*,foundry-rs/foundry-toolchain@*,docker/setup-qemu-action@*,docker/setup-buildx-action@*,docker/login-action@*,docker/build-push-action@*,docker/metadata-action@*,aquasecurity/trivy-action@*,sigstore/cosign-installer@*,opentofu/setup-opentofu@*,actions/attest-build-provenance@*,hashicorp/setup-terraform@*,terraform-linters/setup-tflint@*To audit drift against what’s actually referenced in the reusables:
Terminal window grep -rhoE 'uses: [^@[:space:]]+' .github/workflows/ \| sort -u -
Workflow permissions default: Read repository contents and packages permissions. Individual workflows opt into more via their own
permissions:block. -
Allow GitHub Actions to create and approve pull requests: Disabled. Prevents a malicious action from self-approving.
-
Artifact and log retention: 30 days.
Domain verification
Section titled “Domain verification”- Verified domains:
nyuchi.com,mukoko.com,siafudb.org,travel-info.co.zw,barstool.co.zw. Email notifications for commits go only to addresses on verified domains, which makes commit impersonation harder.
Repository-level defaults
Section titled “Repository-level defaults”These should hold for every public repo under
nyuchi, including any new repo created going forward.
General
Section titled “General”| Setting | Value |
|---|---|
| Default branch | main |
| Template repository | Disabled (unless the repo IS a template) |
| Require contributors to sign off | Enabled (DCO via Signed-off-by) |
| Issues | Enabled |
| Discussions | Enabled on primary ecosystem repos |
| Wiki | Disabled — we keep docs in repos |
| Projects | Enabled |
| Preserve this repository | Enabled on public repos |
Pull requests and merge settings
Section titled “Pull requests and merge settings”| Setting | Value |
|---|---|
| Allow merge commits | Enabled (promotion only) |
| Allow squash merging | Enabled (default) |
| Allow rebase merging | Enabled |
| Default commit message for squash | Pull request title and description |
| Always suggest updating PR branches | Enabled |
| Allow auto-merge | Enabled |
| Automatically delete head branches | Enabled |
Branch protection for main
Section titled “Branch protection for main”One standard covers every org in the enterprise: nyuchi,
mukoko-dev, mzizi-dev, shamwari-ai, bundu-labs, openNTL and
siafuDB. It has four layers:
- One enterprise ruleset,
enterprise-main-protection, set on thebundu-labsenterprise and active on the default branch of every repo in every org (exceptsandbox-*andarchive-*). It holds the floor: pull request required with 0 approvals, no force pushes, no deletion. Linear history is not required on the default branch (see Merges below). It carries no status checks. - One org ruleset per org,
org-wide-main-protection, the same in every org. It repeats the floor and adds what the enterprise does not: the five required lint status checks and a “Require workflows to pass” rule naming that org’s<org>/.github/.github/workflows/org-lint.yml. Its JSON (as applied tonyuchi) isgithub-rulesets/org-wide-main-protection.json. - At most one repo ruleset per repo, named
repo-ci, holding only that repo’s own CI checks (and amerge_queuerule where one already exists). A repo ruleset never repeats the org’s rules and never sets reviews or merge methods, because a narrower repo-level list silently overrides the org’s. - No classic branch protection on any default branch. Rulesets are the single source of truth.
The org ruleset (Settings → Rules → Rulesets):
| Rule | Value |
|---|---|
| Target | The default branch of every repo except sandbox-* and archive-* |
| Bypass | Organisation admins, always |
| Restrict deletions | Enabled |
| Block force pushes | Enabled |
| Require linear history | Disabled on the default branch |
| Require a pull request before merging | Enabled |
| Required approving reviews | 0 (pre-scale solo-developer phase) |
| Dismiss stale pull request approvals when new commits are pushed | Disabled |
| Require review from Code Owners | Deferred until ≥ 2 engineers with merge rights |
| Require approval of the most recent reviewable push | Deferred until ≥ 2 engineers with merge rights |
| Require approval for unattributed changes | Disabled (it asks for an approval a solo owner cannot give) |
| Require conversation resolution before merging | Enabled |
| Allowed merge methods | Merge, squash |
| Require status checks to pass | Enabled — the five lint checks below |
| Require workflows to pass | Enabled — <org>/.github/.github/workflows/org-lint.yml |
| Require branches to be up to date before merging | Enabled |
| Require signed commits | Not a ruleset rule. Signing is policy (see CONTRIBUTING.md). |
Pre-scale reviewer posture. The reviewer count is 0 during the solo-developer phase, per NA-01 Article 4.2 (flat structure, pre-scale reality). Every PR still goes through the pull-request flow, CI gates, DCO sign-off and conversation-resolution gates — just without an external reviewer because there isn’t one yet. As soon as a second engineer with merge rights joins the org, the ruleset flips back to
required_approving_review_count: 1, with.github, security, and infra repositories rising to2per the original design. The trigger is documented in NA-01 Article 10.1 (the transition to formal divisional structure).
Merges. The estate is trunk-based: every PR targets the default branch
and every merge there is a release (see Automatic releases). There is no
staging branch. The staging rulesets and the promotion design in
settings/ are historical and apply to no repo.
Required status checks
Section titled “Required status checks”Every adopter calls the org’s reusable workflows. Status check
names take the form <caller-job-name> / <reusable-job-name>. By
convention, every repo names its caller job after the workflow
purpose so the contexts read sensibly.
Lint — required on every repo, no exceptions. Lint is an
org-required workflow: each org ruleset’s “Require workflows to
pass” rule names <org>/.github/.github/workflows/org-lint.yml, so
GitHub runs it on every pull request in every repo of the org. A repo
needs no lint.yml of its own and no lint config files: the
org-lint job calls nyuchi/.github’s reusable-lint.yml, which uses a
repo’s own .prettierrc, .prettierignore, .markdownlint.jsonc or
.yamllint.yaml where present and falls back to the canonical copies in
this repository where not. Its job is named lint, so it publishes:
lint / actionlintlint / JSON validitylint / prettierlint / markdownlintlint / yamllint
These five run on every PR to every repo and are blocking. CI does not auto-fix; the developer fixes locally and pushes.
Per-repo CI — required where applicable (caller-job names shown are conventions; the second segment is the reusable-job name and is fixed):
pr-title / Conventional Commits— fromreusable-pr-title-lint.ymldep-review / Review dependencies— fromreusable-dependency-review.ymlcodeql / Analyze (*)— fromreusable-codeql.yml, per enabled language- The primary CI job(s) — from whichever of
reusable-ci-nextjs-monorepo.yml,reusable-ci-rust-monorepo.yml,reusable-ci-python-monorepo.yml, orreusable-ci-docs-mdx.ymlthe repo uses.
Supply-chain and security gates added per-stack:
ci / pnpm audit— fromreusable-ci-nextjs-monorepo.yml(moderate+ CVEs fail the PR; matchesdependency-reviewbut uses the pnpm lockfile directly)ci / pip-audit— fromreusable-ci-python-monorepo.yml(scans the exporteduvlockfile against PyPI advisory DB)ci / cargo deny— fromreusable-ci-rust-monorepo.yml(advisories, bans, licence compliance, source verification; requiresdeny.tomlin the repo root)
Tag protection
Section titled “Tag protection”- Tags matching
v*require admin or@nyuchi/maintainersteam approval to create, move, or delete. Prevents accidental release-tag rewrites.
Secrets and tokens
Section titled “Secrets and tokens”Org secrets (available to all repos by default)
Section titled “Org secrets (available to all repos by default)”| Name | Used by | Source |
|---|---|---|
TURBO_TOKEN |
ci-nextjs-monorepo.yml |
Vercel Remote Cache |
TURBO_TEAM |
ci-nextjs-monorepo.yml |
Vercel Remote Cache |
No long-lived cloud credentials (AWS keys, GCP service-account JSON, Cloudflare API tokens) should be stored as org or repo secrets. Use OIDC federation with the cloud provider and scope the trust policy to specific repos + branches + environments.
Dependabot
Section titled “Dependabot”Dependabot cannot read regular Actions secrets. If a Dependabot- triggered workflow needs a secret, configure it at Settings → Secrets and variables → Dependabot, and prefer narrowly-scoped tokens.
Enforcement and audit
Section titled “Enforcement and audit”-
Rulesets: branch and tag protection is enforced via GitHub Rulesets, not legacy branch-protection rules. The definitions live in
github-rulesets/in this repo:org-wide-main-protection.json— the org ruleset described in §Branch protection formain, the same in every org apart from theworkflowsrule’s repository id.release-tag-protection.json— applied tonyuchi/.github(protectsv*.*.*tags). Tag and push rulesets are outside the branch standard and are left as they are.
There is no per-repo copy of the org rules. The former
main-branch-protection.jsonrepeated them fornyuchi/.githuband narrowed merges to rebase only; it is removed from the standard, and the live copy is deleted when the standard is applied.The standard is applied across the orgs by the owner’s rollout script (dry run by default), which also removes duplicate repo rulesets and classic protection. To update one org ruleset by hand, PUT the JSON to the existing ruleset’s id:
Terminal window gh api orgs/nyuchi/rulesets --jq '.[] | [.id, .name] | @tsv'gh api --method PUT /orgs/nyuchi/rulesets/<id> \--input github-rulesets/org-wide-main-protection.jsonThe org ruleset JSON names
nyuchi/.githubbyrepository_idin itsworkflowsrule. Each org’s live ruleset points at its own<org>/.githubrepository instead, so swap the id before applying the file to another org.The
enterprise-main-protectionruleset is set on thebundu-labsenterprise (Enterprise settings → Policies → Code → Rulesets) and is active across every org. It holds pull request (0 approvals), linear history, no force push and no deletion; status checks and the required lint workflow live only in each org ruleset. -
In progress — infrastructure as code: migrating org and repo configuration to OpenTofu (the open-source Terraform fork) using the
integrations/githubprovider. When complete this document becomes a generated artifact rather than hand-maintained prose. Target: all new repos provisioned viatofu applyby Q3 2026. Thereusable-ci-opentofu.ymlreusable workflow supports this. -
Quarterly audit (automated): a GitHub Actions scheduled workflow (
.github/workflows/scheduled-settings-audit.yml) opens a GitHub Issue on the first day of every quarter with a checklist of items to verify. Close the issue once the audit is complete and any drift has been corrected.
Artifact provenance and supply-chain security
Section titled “Artifact provenance and supply-chain security”SLSA provenance (SLSA L2)
Section titled “SLSA provenance (SLSA L2)”Every release attaches a GitHub Artifact Attestation (SLSA L2
provenance) signed with a short-lived OIDC token via Sigstore. This is
generated automatically by the attestations step in
reusable-release.yml and by the standalone
reusable-slsa-provenance.yml workflow.
Attestations can be verified by any user with read access to the repository:
gh attestation verify <artifact-file> --repo nyuchi/<repo>Each release also ships a SHA256SUMS file covering all attached
release assets. Consumers must verify this file against the attestation
before executing any release artifact.
OpenSSF alignment
Section titled “OpenSSF alignment”The organisation targets the following OpenSSF / SLSA milestones:
| Practice | Target |
|---|---|
| SHA-pinned Actions (supply-chain) | Enforced — NA-03 §7.1.1 |
| SBOM on every production release | Enforced — NA-03 §7.2, reusable-sbom.yml |
| Artifact provenance (SLSA L2) | Enforced — reusable-release.yml + attestation step |
| OIDC federation for cloud credentials | Required — see §Secrets and tokens below |
| Dependency review on every PR | Enforced — reusable-dependency-review.yml |
| Secret scanning (all patterns) | Enabled — org-wide |
Signed commits on main |
Policy — not enforced by a ruleset |
| OpenSSF Scorecard | Available — reusable-openssf-scorecard.yml |
| SLSA L3 (hermetic builds) | Planned — requires isolated build runners |
Reusable workflow versioning and rollback
Section titled “Reusable workflow versioning and rollback”Consuming repos reference reusables at @main, so changes propagate
instantly on the next CI run. To avoid a broken change from silently
affecting every downstream repo:
- Test in isolation first. Always run the reusable’s own
lint.ymlCI before merging tomain. - Use feature flags via workflow inputs. New behaviour is opt-in
(
default: false) for at least one release cycle before becoming the default. - Rollback procedure. If a merged change breaks downstream repos:
- Open a hotfix branch in
nyuchi/.github. - Revert the offending commit.
- Merge immediately (no waiting for the normal review bar if the regression is confirmed and the Founder approves — per NA-01 Article 6.1(a)).
- Notify affected repo maintainers via a GitHub Issue.
- Open a hotfix branch in
- Versioned refs (planned). Long-term, critical consumers should
reference a
@v1,@v2tag rather than@mainto opt into upgrades deliberately. This is tracked as a future enhancement.
OIDC federation for cloud credentials
Section titled “OIDC federation for cloud credentials”Long-lived cloud API keys (AWS, GCP, Cloudflare, Fly.io) must not be stored as GitHub secrets. Use OIDC federation so workflows obtain short-lived tokens at runtime. The trust policy must be scoped to specific repositories, branches, and environments.
Cloudflare example
Section titled “Cloudflare example”- name: Authenticate to Cloudflare via OIDC uses: cloudflare/cloudflare-action@v1 # pin to SHA per NA-03 §7.1.1 with: api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }} # narrow-scope tokenFor a Cloudflare Workers deployment the preferred approach is Wrangler with a scoped API token generated from a service account, not a Global API key.
Fly.io example
Section titled “Fly.io example”- name: Deploy to Fly.io env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} # deploy-only token run: flyctl deploy --remote-onlyGenerate the FLY_API_TOKEN via fly tokens create deploy — this
creates a token scoped to deploy operations only, not account admin.
Store it as a repository- or environment-level secret, never as an
org-level secret unless the token legitimately covers all repos.
AWS / GCP (future)
Section titled “AWS / GCP (future)”When Nyuchi services expand to AWS or GCP, use OIDC federation:
permissions: id-token: write contents: read
steps: - uses: aws-actions/configure-aws-credentials@v4 # pin to SHA with: role-to-assume: arn:aws:iam::123456789012:role/GitHubActionsRole aws-region: af-south-1 role-session-name: GitHubActionsDocument the trust policy (aud, sub conditions) in the Terraform
module for that environment.
Supply chain security
Section titled “Supply chain security”Container signing and verification
Section titled “Container signing and verification”All OCI images built and published by Nyuchi repos must be:
- Scanned by Trivy (CRITICAL + HIGH severity — exit-code 1) before push.
- Signed with cosign keyless signing using the
reusable-ci-container.ymlreusable workflow. - Verified by consumers:
cosign verify --certificate-oidc-issuer https://token.actions.githubusercontent.com --certificate-identity-regexp 'https://github.com/nyuchi/'.
The OIDC issuer and identity regexp above act as the trust anchor —
only images built by a GitHub Actions workflow in the nyuchi org
will verify successfully. Do not use a long-lived cosign key.
SLSA provenance
Section titled “SLSA provenance”All published releases must include SLSA level 2 provenance attestations (enforced today — see “SLSA provenance (SLSA L2)” above):
- The
reusable-release.ymlreusable workflow already attaches a CycloneDX SBOM (NA-03 §7.2). - Container images built by
reusable-ci-container.ymlinclude BuildKit-generated SBOM and provenance viasbom: trueandprovenance: truein the build step. - For binary releases (Rust crates, Python wheels, JS packages),
add SLSA provenance via
slsa-framework/slsa-github-generatorwhen the toolchain supports it.
Trivy IaC scanning
Section titled “Trivy IaC scanning”All OpenTofu / Terraform configurations must be scanned with Trivy
in config mode (CRITICAL + HIGH). The reusable-ci-opentofu.yml
reusable workflow does this automatically. SARIF results appear in
each repo’s GitHub Security tab.
Automatic releases
Section titled “Automatic releases”Every 15 minutes, Auto release (.github/workflows/auto-release.yml)
runs scripts/auto-release-prs.sh for each of the seven orgs. For every
repo (not archived, not sandbox-*/archive-*):
- Where the default-branch tip is untagged, it is tagged (a
featis a MINOR, anything else a PATCH) and published as the latest GitHub release, as the enterprise-owned bundu-release GitHub App — the app’s private key lives only in theorg-releaseenvironment, which onlymaincan deploy from. Repos that tag their own releases (main-release.yml, orrelease.ymlcallingreusable-trunk-release.yml) are skipped.
A MAJOR is only ever made by hand. A repo opts out with the
AUTO_RELEASE=off repository variable.
Hourly repo bootstrap
Section titled “Hourly repo bootstrap”Every hour at :23, Bootstrap repos
(.github/workflows/bootstrap-repos.yml) runs
scripts/bootstrap-repos.sh for each org: every repo has a default
branch, the standard merge
settings, immutable releases, the standard labels, and the standard
files — missing files are proposed in one pull request, never pushed
directly. Run it by hand from the Actions tab for an instant fix.
All checks green, required everywhere
Section titled “All checks green, required everywhere”Owner decision (2026-11-17): nothing merges while any check is red or orange,
in every repository. .github/workflows/all-checks-green.yml is the one gate:
it waits on every other check run and commit status on the commit under test
and fails on anything red, or anything still pending after 40 minutes. It is
required through the same “Require workflows to pass” rule as Org lint, so the
All checks green context exists in every repository with no per-repo file.
- Merge
all-checks-green.ymltomainhere (the rule points atmain). - Copy that file verbatim to each organisation’s own
<org>/.githubmain: GitHub rejects a required workflow sourced from another organisation, even a public repository, so each org carries its own copy. - Each organisation:
settings/require-all-green.sh <org> ...to see the change, then again with--apply. It needs an org admin. - Remove any per-repository
all-green.ymlcopies, so the context does not run twice.
Related documents
Section titled “Related documents”- Contributing — the rules branch protection enforces.
- Engineering guide — agent-specific additions to those rules.
.github/CODEOWNERS— the review routing that pairs with “Require review from Code Owners”.SECURITY.md— vulnerability reporting workflow that depends on “Private vulnerability reporting” being enabled.