Skip to content

Commit

Permalink
Merge pull request mage-os#86 from sprankhub/terraform-github-provide…
Browse files Browse the repository at this point in the history
…r-v6

Update Terraform GitHub provider to v6
  • Loading branch information
sprankhub authored May 21, 2024
2 parents baf00fb + 1b3eb0e commit 2b26852
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
34 changes: 17 additions & 17 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
required_providers {
github = {
source = "integrations/github"
version = "~> 5.25"
version = "~> 6.2"
}
}
}
Expand Down Expand Up @@ -82,11 +82,14 @@ resource "github_repository" "mirrors" {
}

resource "github_branch_protection" "mirrors" {
for_each = var.mirror_repositories
repository_id = github_repository.mirrors[each.key].node_id
pattern = "*"
enforce_admins = true
push_restrictions = [data.github_user.mage-os-ci.node_id]
for_each = var.mirror_repositories
repository_id = github_repository.mirrors[each.key].node_id
pattern = "*"
enforce_admins = true
restrict_pushes {
blocks_creations = false
push_allowances = [data.github_user.mage-os-ci.node_id]
}
allows_force_pushes = true
}

Expand All @@ -113,8 +116,10 @@ resource "github_branch_protection" "repositories-release-please" {
for_each = { for key, value in var.repositories : key => value if try(value.release_please_branch, "") != "" }
repository_id = github_repository.repositories[each.key].node_id
pattern = each.value.release_please_branch

push_restrictions = [data.github_user.mage-os-ci.node_id]
restrict_pushes {
blocks_creations = false
push_allowances = [data.github_user.mage-os-ci.node_id]
}
force_push_bypassers = [data.github_user.mage-os-ci.node_id]
}

Expand Down

0 comments on commit 2b26852

Please sign in to comment.