diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl index 1aa5f70..04140ce 100644 --- a/.terraform.lock.hcl +++ b/.terraform.lock.hcl @@ -2,23 +2,23 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/integrations/github" { - version = "5.45.0" - constraints = "~> 5.25" + version = "6.2.1" + constraints = "~> 6.2" hashes = [ - "h1:cP5uEN9jpePr+/Kc7OyAZMhysbDhQoLGpLqgQpLFewg=", - "zh:2afb8ee5b847071e51d5a39bcad5cf466c4d22452450d37c44a5f9d2eb9879e5", - "zh:38d087b88c86ddd63b60d14d613f86a5885d154048098c0484266a9a69018b16", - "zh:3e6a787e3e40f1535d85f8dc5f2e8c90242ab8237feebd027f696fa154261394", - "zh:55dac5a813b3774b48ca45b8a797c32e6d787d4f282b43b622155cad3daac46a", - "zh:563f2782f3c4c584b249c5fa0628951a57b4593f3c5805a4efb6d494f8686716", - "zh:677180ec9376d5f926286592998e2864c85f06d6b416c1d89031d817a285c72e", - "zh:80eec141fa47131e8f60a6478e51b3a5920efe803444e684f9605fca09a24e34", - "zh:8b9f1e1f4b42b51e53767f4f927eabdcefe55fb0369e996ac2a0063148b5e48d", - "zh:95627f75848561830f8c20949f024f902a2100a022c68aa8d84320f43e75cc46", - "zh:95ac41b99dfca3ce556092e036bb04dc03367d0779071112e59d4bf11259a89d", - "zh:9e966482729ba8214b480bdd786aff9a15234e9c093c5406b56ce89ccb07dcab", - "zh:b7a9d563613f1b9a233f8f285848cc9d8c08c556aad7ea57cd63e0abb19b10cf", - "zh:ce56bb7ca876f47f5beee01de3ab84d27964b972c9adceb8e2f7824891e05c27", - "zh:f73e063ad5b84f1943eafb8a52a26dd805d06ac11d6c951175ac76c07187f553", + "h1:ip7024qn1ewDqlNucxh07DHvuhSLZSqtTGewxNLeYYU=", + "zh:172aa5141c525174f38504a0d2e69d0d16c0a0b941191b7170fe6ae4d7282e30", + "zh:1a098b731fa658c808b591d030cc17cc7dfca1bf001c3c32e596f8c1bf980e9f", + "zh:245d6a1c7e632d8ae4bdd2da2516610c50051e81505cf420a140aa5fa076ea90", + "zh:43c61c230fb4ed26ff1b04b857778e65be3d8f80292759abbe2a9eb3c95f6d97", + "zh:59bb7dd509004921e4322a196be476a2f70471b462802f09d03d6ce96f959860", + "zh:5cb2ab8035d015c0732107c109210243650b6eb115e872091b0f7b98c2763777", + "zh:69d2a6acfcd686f7e859673d1c8a07fc1fc1598a881493f19d0401eb74c0f325", + "zh:77f36d3f46911ace5c50dee892076fddfd64a289999a5099f8d524c0143456d1", + "zh:87df41097dfcde72a1fbe89caca882af257a4763c2e1af669c74dcb8530f9932", + "zh:899dbe621f32d58cb7c6674073a6db8328a9db66eecfb0cc3fc13299fd4e62e7", + "zh:ad2eb7987f02f7dd002076f65a685730705d04435313b5cf44d3a6923629fb29", + "zh:b2145ae7134dba893c7f74ad7dfdc65fdddf6c7b1d0ce7e2f3baa96212322fd8", + "zh:bd6bae3ac5c3f96ad9219d3404aa006ef1480e9041d4c95df1808737e37d911b", + "zh:e89758b20ae59f1b9a6d32c107b17846ddca9634b868cf8f5c927cbb894b1b1f", ] } diff --git a/main.tf b/main.tf index 2914af8..9907027 100644 --- a/main.tf +++ b/main.tf @@ -7,7 +7,7 @@ terraform { required_providers { github = { source = "integrations/github" - version = "~> 5.25" + version = "~> 6.2" } } } @@ -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 } @@ -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] }