This repository has been archived on 2026-11-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
terraform-git/README.md
T
unkin-agent 1889c95a46
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
document fork_from as create-only and private as unset by default
2026-11-19 22:30:38 +11:00

73 lines
2.5 KiB
Markdown

# terraform-git
Manage Gitea resources, teams, repos, and Woodpecker CI via Terraform.
## GitHub (IUCLabs)
`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.
`config.yaml` (optional, every field):
```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/<name>.yaml`:
```yaml
description: "IUCLabs maintainers"
privacy: closed
maintainers: [neoloc]
members: []
```
`repository/<name>.yaml` (every field, with defaults):
```yaml
description: ""
private: null # null = private; must be omitted with fork_from
default_branch: main
maintainers: [] # users or @team: maintain access, seed initial .github/CODEOWNERS
codeowners: [] # push access
merge_type: squash # squash | merge | rebase
delete_branch_on_merge: true
rulesets: [] # opt-in rulesets from ruleset/
exclude_rulesets: [] # opt out of non-mandatory all_repos rulesets
fork_from: null # owner/repo: fork a public upstream (see below)
```
`fork_from: owner/repo` creates the repository as a fork of a public upstream. Visibility follows the source, so `private` must be omitted. `default_branch` must match the upstream default branch. `fork_from` only works when creating a new repository: the old one is archived on destroy and keeps the name, so to convert an existing repository delete it on GitHub (or `terragrunt state rm` its repository resources) first.
`ruleset/<name>.yaml`:
```yaml
all_repos: false # apply to every repo
mandatory: false # cannot be excluded
target: branch # branch | tag
enforcement: active
bypass_actors: # optional; bypass_mode always | pull_request | exempt (default always)
- {actor_type: Team, team: maintainers} # team from team/
- {actor_type: OrganizationAdmin}
- {actor_type: RepositoryRole, actor_id: 5, bypass_mode: pull_request}
conditions:
ref_name:
include: ["refs/heads/release/*"]
exclude: []
rules:
creation: false
deletion: true
non_fast_forward: true
required_status_checks: {contexts: [ci/woodpecker], strict: true} # branch only
```
Shipped rulesets: `branch-protection`, `tag-protection` (all repos), `ref-names-branch`, `ref-names-tag` (mandatory).