Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Terraform GitHub provider to v6 #86

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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