48 lines
1.3 KiB
Markdown
48 lines
1.3 KiB
Markdown
# terraform-git
|
|
|
|
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.
|
|
|
|
`team/<name>.yaml`:
|
|
|
|
```yaml
|
|
description: "IUCLabs maintainers"
|
|
privacy: closed
|
|
maintainers: [neoloc]
|
|
members: []
|
|
```
|
|
|
|
`ruleset/<name>.yaml` (applied per repository; org rulesets need a paid plan):
|
|
|
|
```yaml
|
|
target: branch
|
|
enforcement: active
|
|
conditions:
|
|
ref_name:
|
|
include: ["~DEFAULT_BRANCH"]
|
|
exclude: []
|
|
rules:
|
|
deletion: true
|
|
non_fast_forward: true
|
|
pull_request:
|
|
required_approving_review_count: 0
|
|
dismiss_stale_reviews_on_push: true
|
|
required_status_checks:
|
|
contexts: [ci/woodpecker]
|
|
```
|
|
|
|
`repository/<name>.yaml` (squash-only, delete branch on merge, `main` by default):
|
|
|
|
```yaml
|
|
description: "IUCLabs organisation profile"
|
|
private: false
|
|
rulesets: [default]
|
|
maintainers: ["@maintainers"]
|
|
codeowners: []
|
|
```
|
|
|
|
`maintainers` (users or `@team`) get `maintain` and seed the initial `.github/CODEOWNERS` on `auto_init` repositories, which is then left to humans. `codeowners` get `push` so they can be added to CODEOWNERS later. Private repositories cannot use rulesets on the free plan; plan fails if they do.
|