From fdc9c01baa75cfcee66bbaf5067c932a3ae87043 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Sat, 14 Nov 2026 21:51:46 +1100 Subject: [PATCH] Trim GitHub README section to layout and examples --- README.md | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 099548a..407c1ec 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,22 @@ Manage Gitea resources, teams, repos, and Woodpecker CI via Terraform. ## GitHub (IUCLabs) -`config/github.com/IUCLabs/` feeds `modules/github_org` via `environments/github/iuclabs`, authenticated as a GitHub App (`kv/service/github/iuclabs/terraform`). Org membership invites are manual. +`config/github.com/IUCLabs/` → `environments/github/iuclabs` → `modules/github_org`. GitHub App credentials and `billing_email` come from `kv/service/github/iuclabs/terraform`. Org membership invites are manual. -`modules/github_org` validates config, manages org-level settings, and calls `modules/team` (team + memberships), `modules/repository` (repo, default branch, collaborators, CODEOWNERS) and `modules/ruleset` once per effective `/` pair, after the repositories. +`config.yaml` (optional, every field): -`config.yaml` (optional) manages org settings: profile (`name`, `description`, `blog`, `location`, `email`, `twitter_username`, `company`), `default_repository_permission` (read, or none), `members_can_create_repositories` (false), `public_runners` (false; lets public repos use the Default runner group). Every other org setting is pinned in the module (no Pages, no repo projects, legacy security toggles off), and `GITHUB_TOKEN` is read-only and non-approving. `billing_email` comes from the `billing_email` field of the same Vault path (`TF_VAR_billing_email`). These resources are `prevent_destroy`, so deleting `config.yaml` fails the plan; to stop managing them, add `removed { from = ; lifecycle { destroy = false } }` blocks to `modules/github_org`. +```yaml +name: IUCLabs +description: "" +blog: "" +location: "" +email: "" +twitter_username: "" +company: "" +default_repository_permission: read # read | none +members_can_create_repositories: false +public_runners: false # public repos may use the Default runner group +``` `team/.yaml`: @@ -26,18 +37,18 @@ description: "" private: true default_branch: main maintainers: [] # users or @team: maintain access, seed initial .github/CODEOWNERS -codeowners: [] # push access, for adding to CODEOWNERS later +codeowners: [] # push access merge_type: squash # squash | merge | rebase delete_branch_on_merge: true -rulesets: [] # opt-in rulesets from ruleset/ (public repos only) +rulesets: [] # opt-in rulesets from ruleset/; public repos only exclude_rulesets: [] # opt out of non-mandatory all_repos rulesets ``` -`ruleset/.yaml` defines every ruleset: +`ruleset/.yaml`: ```yaml -all_repos: false # apply to every public repo (private repos are skipped) -mandatory: false # cannot be listed in exclude_rulesets +all_repos: false # apply to every public repo; private repos get no all_repos rulesets +mandatory: false # cannot be excluded target: branch # branch | tag enforcement: active conditions: @@ -48,10 +59,7 @@ rules: creation: false deletion: true non_fast_forward: true + required_status_checks: {contexts: [ci/woodpecker], strict: true} # branch only ``` -`branch-protection` (PRs on the default branch) and `tag-protection` (`refs/tags/v*` undeletable, immutable) apply to all public repos. `ref-names-branch` and `ref-names-tag` are mandatory: they block refs with a `+` path component, which would act as a wildcard in Vault policy paths templated from the GitHub OIDC `ref` claim. - -Required status checks are a custom ruleset referenced via `rulesets:`, e.g. `rules: {required_status_checks: {contexts: [ci/woodpecker], strict: true}}`. - -Private repositories cannot list `rulesets` on the free plan; plan fails if they do. Unknown names, excluding a mandatory ruleset, or listing a ruleset in both lists also fail. +Shipped rulesets: `branch-protection`, `tag-protection` (all public repos), `ref-names-branch`, `ref-names-tag` (mandatory).