Declarative GitHub infrastructure
Manage repository settings, labels, rulesets and files in YAML. Review the changes with plan, then apply exactly those. No state file, no HCL.
$ gh extension install babarot/gh-infrarepos/my-project.yaml
spec:
visibility: public
features:
wiki: false discussions: true topics: [go, cli]gh infra plan ./repos/
~ babarot/my-project 3 to update
~ features.wiki true → false
~ features.discussions false → true
~ topics [] → [go, cli]From an existing repository to YAML you review
Start from what is on GitHub today. Every later change goes through a plan.
Import
get the current settingsgh infra import$ gh infra import babarot/my-project \ > repos/my-project.yaml apiVersion: gh-infra/v1 kind: Repository ...Plan
edit the YAML, see the diffgh infra plan~ babarot/my-project ~ features.wiki true → false ~ topics [] → [go, cli] Plan: ~ 2 to updateApply
make exactly those changesgh infra apply✓ babarot/my-project 2 applied $ gh infra plan ./repos/ No changes. Infrastructure is up-to-date.
Built for plan-only review
A pull request shows the plan, and merging it runs apply. Nobody watches the apply, so three rules keep the plan honest.
apply does what plan shows
Every change apply makes is in the plan, and apply makes no other change.
What you leave out is left alone
A field that is not in the manifest is not compared and not sent.
One apply converges
After apply, the next plan shows no changes.
Four resource kinds
Manage one repository in detail, or share configuration across many.