Commit b3d4ef6c authored by David McKay's avatar David McKay

feat: add branch protection through Terraform

parent 2df21790
name: Terraform
name: Repository Configuration with Terraform
on:
push:
......
......@@ -8,8 +8,8 @@ provider "google" {
}
provider "github" {
token = var.github_token
organization = "influxdata"
anonymous = false
}
terraform {
......@@ -18,7 +18,3 @@ terraform {
prefix = "github.com/helm-charts"
}
}
variable "github_token" {
type = string
}
......@@ -3,7 +3,8 @@ resource "github_repository" "helm_charts" {
description = "Official Helm Chart Repository for InfluxData Applications"
allow_merge_commit = false
allow_rebase_merge = false
allow_squash_merge = false
allow_rebase_merge = true
has_downloads = true
has_issues = true
......@@ -18,6 +19,25 @@ resource "github_repository" "helm_charts" {
private = false
}
resource "github_branch_protection" "helm_charts_master" {
repository = "${github_repository.helm_charts.name}"
branch = "master"
enforce_admins = true
required_status_checks {
strict = true
}
required_pull_request_reviews {
dismiss_stale_reviews = true
require_code_owner_reviews = true
required_approving_review_count = 2
}
restrictions {
}
}
variable "colour_dark_blue" {
type = string
default = "779ecb"
......@@ -34,4 +54,3 @@ resource "github_issue_label" "types" {
repository = github_repository.helm_charts.name
color = var.colour_dark_blue
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment