diff --git a/terraform/github/branches.tf b/terraform/github/branches.tf index c7db184b..9147a839 100644 --- a/terraform/github/branches.tf +++ b/terraform/github/branches.tf @@ -23,7 +23,7 @@ resource "github_branch_protection" "ansible_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) + contexts = lookup(var.required_status_checks, each.key, {"all":[]}).all strict = false } @@ -52,7 +52,7 @@ resource "github_branch_protection" "batch_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) + contexts = lookup(var.required_status_checks, each.key, {"all":[]}).all strict = false } @@ -84,7 +84,7 @@ resource "github_branch_protection" "kayobe_branch_protection_py_3-6" { ] required_status_checks { - contexts = lookup(lookup(var.required_status_checks, each.key, {"none": []}), github_branch_protection.kayobe_branch_protection_py_3-6[each.key].pattern, lookup(var.required_status_checks, each.key, { + contexts = lookup(lookup(var.required_status_checks, each.key, {"none": []}), "stackhpc/[vwxy]*", lookup(var.required_status_checks, each.key, { "all": [ "tox / Tox pep8 with Python 3.8", "tox / Tox py3 with Python 3.8", @@ -119,7 +119,7 @@ resource "github_branch_protection" "kayobe_branch_protection_py_3-10" { ] required_status_checks { - contexts = lookup(lookup(var.required_status_checks, each.key, {"none": []}), github_branch_protection.kayobe_branch_protection_py_3-10[each.key].pattern, lookup(var.required_status_checks, each.key, { + contexts = lookup(lookup(var.required_status_checks, each.key, {"none": []}), "stackhpc/[z,2]*", lookup(var.required_status_checks, each.key, { "all": [ "tox / Tox pep8 with Python 3.10", "tox / Tox py3 with Python 3.10", @@ -157,11 +157,13 @@ resource "github_branch_protection" "openstack_branch_protection_py_3-6" { } required_status_checks { - contexts = lookup(var.required_status_checks, each.key, [ - "tox / Tox pep8 with Python 3.8", - "tox / Tox py3 with Python 3.6", - "tox / Tox py3 with Python 3.8", - ]) + contexts = lookup(lookup(var.required_status_checks, each.key, {"none": []}), "stackhpc/[vwxy]*", lookup(var.required_status_checks, each.key, { + "all": [ + "tox / Tox pep8 with Python 3.8", + "tox / Tox py3 with Python 3.8", + "tox / Tox py3 with Python 3.6" + ] + }).all) strict = false } lifecycle { @@ -189,11 +191,13 @@ resource "github_branch_protection" "openstack_branch_protection_py_3-10" { } required_status_checks { - contexts = lookup(var.required_status_checks, each.key, [ - "tox / Tox pep8 with Python 3.10", - "tox / Tox py3 with Python 3.10", - "tox / Tox py3 with Python 3.8", - ]) + contexts = lookup(lookup(var.required_status_checks, each.key, {"none": []}), "stackhpc/[z,2]*", lookup(var.required_status_checks, each.key, { + "all": [ + "tox / Tox pep8 with Python 3.10", + "tox / Tox py3 with Python 3.10", + "tox / Tox py3 with Python 3.8" + ] + }).all) strict = false } @@ -222,7 +226,7 @@ resource "github_branch_protection" "platform_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) + contexts = lookup(var.required_status_checks, each.key, {"all":[]}).all strict = false } @@ -251,7 +255,7 @@ resource "github_branch_protection" "releasetrain_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) + contexts = lookup(var.required_status_checks, each.key, {"all":[]}).all strict = false } @@ -280,7 +284,7 @@ resource "github_branch_protection" "smslab_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) + contexts = lookup(var.required_status_checks, each.key, {"all":[]}).all strict = false }