Interview Prep/Git & GitHub/Governance, migration, automation and cost

How do you manage GitHub organisation settings as code?

IntermediateProductionGovernance, migration, automation and cost
Answer

With the Terraform GitHub provider or Probot settings: repos, teams, rulesets, branch protection and environments are declared in a repo, reviewed by PR and applied by a pipeline. Drift is detected with scheduled terraform plan. Manual changes become visible instead of silently accumulating.

resource "github_repository" "app" {
  name       = "app"
  visibility = "private"
  delete_branch_on_merge = true
}
All Git & GitHub questions Roadmap: Git & GitHub

More on Governance, migration, automation and cost