The GitHub Terraform provider manages GitHub repositories, teams, settings, and automation objects via REST and GraphQL APIs.
Overview
The GitHub Terraform provider lets teams describe GitHub organization and repository resources in Terraform. It covers repositories, teams, branch protections, Actions secrets and variables, organization settings, rulesets, deploy keys, webhooks, and related objects on GitHub.com or GitHub Enterprise Server.
Registry documentation requires a required_providers entry for integrations/github in each module that creates resources. The provider block can set an owner or organization, and authentication supports personal access tokens, GitHub App installations, GitHub CLI tokens, or anonymous read-only access through a defined fallback order.
Enterprise deployments can set a custom base URL for GitHub Enterprise Server or data residency hosts. Optional tuning includes caching paths, retry behavior, pagination limits, and delays to reduce rate limiting during large plans.
It runs within the Terraform CLI when applying configuration against GitHub’s APIs and does not host GitHub itself.
Key features
- Repository and team management
- Branch protection and rulesets
- Actions secrets and variables
- Organization settings resources
- Deploy keys and webhooks
- PAT, App, and gh CLI auth
- GitHub Enterprise Server base URL
- REST and GraphQL API coverage
Use cases
- GitOps repository provisioning
- Standardizing org security settings
- Managing Actions secrets in code
- Enterprise GitHub automation
- Team and access structure as code