This project uses Terraform to manage multiple GitHub repositories following infrastructure as code best practices.
This project implements a modular approach to manage multiple GitHub repositories simultaneously using Terraform. The structure allows creating and managing several repositories while maintaining consistent configuration and branch protection policies across all of them.
Each repository is created with:
main
: Primary branch with protection rulesdevelop
: Development branch for ongoing work
All repositories implement these security measures:
- Protected main branch
- Required code reviews for pull requests
- Automated branch protection rules
Repositories are defined in the terraform.tfvars
file using this structure:
repositories = {
repo1 = {
name = "first-repository"
description = "Description for first repository"
}
repo2 = {
name = "second-repository"
description = "Description for second repository"
}
}
- Clone the repository
git clone ${github_repository.repo.ssh_clone_url}
- Create a new branch from develop for your changes
git checkout develop
git checkout -b feature/your-new-feature