Skip to content

Commit

Permalink
v3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Welsh committed Aug 30, 2023
1 parent 7c7462a commit 4d22829
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions terraform/github/branches.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 4d22829

Please sign in to comment.