Skip to content

Instantly share code, notes, and snippets.

@soerenmartius
Last active March 29, 2020 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soerenmartius/2818055c92ad50e4ad48e28150954132 to your computer and use it in GitHub Desktop.
Save soerenmartius/2818055c92ad50e4ad48e28150954132 to your computer and use it in GitHub Desktop.
GitHub Repository with Branch Protection Rule
module "iac-github" {
source = "mineiros-io/repository/github"
version = "~> 0.1.0"
name = "iac-github"
private = true
description = "An example on how to manage a GitHub organization with Terraform."
allow_merge_commit = true
gitignore_template = "Terraform"
license_template = "mit"
auto_init = true
branch_protections = [
{
branch = "master"
enforce_admins = false
required_status_checks = {
strict = true
contexts = ["ci/semaphoreci/push: IaC-GitHub CI Pipeline"]
}
required_pull_request_reviews = {
dismiss_stale_reviews = true
require_code_owner_reviews = true
required_approving_review_count = 1
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment