Skip to content

Commit 35515a0

Browse files
committed
refactor!: Rename required_status_checks.contexts to required_status_checks.checks as contexts is depcrecated
1 parent f7aaf46 commit 35515a0

File tree

8 files changed

+17
-15
lines changed

8 files changed

+17
-15
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
- BREAKING CHANGE: Bump minimum supported version of the GitHub provider to `v5.16`
1717
as it contains a [critical fix](https://github.com/integrations/terraform-provider-github/pull/1415) for branch protections.
18+
- BREAKING CHANGE: Rename `required_status_checks.contexts` to `required_status_checks.checks` as contexts is
19+
depcrecated in v3 branch protections
1820

1921
## [0.18.0]
2022

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ This is due to some terraform limitation and we will update the module once terr
543543

544544
Default is `false`.
545545

546-
- [**`contexts`**](#attr-branch_protections_v3-required_status_checks-contexts): *(Optional `list(string)`)*<a name="attr-branch_protections_v3-required_status_checks-contexts"></a>
546+
- [**`checks`**](#attr-branch_protections_v3-required_status_checks-checks): *(Optional `list(string)`)*<a name="attr-branch_protections_v3-required_status_checks-checks"></a>
547547

548548
The list of status checks to require in order to merge into this branch. If default is `[]` no status checks are required.
549549

@@ -749,7 +749,7 @@ This is due to some terraform limitation and we will update the module once terr
749749

750750
Default is `false`.
751751

752-
- [**`contexts`**](#attr-branch_protections_v4-required_status_checks-contexts): *(Optional `list(string)`)*<a name="attr-branch_protections_v4-required_status_checks-contexts"></a>
752+
- [**`checks`**](#attr-branch_protections_v4-required_status_checks-checks): *(Optional `list(string)`)*<a name="attr-branch_protections_v4-required_status_checks-checks"></a>
753753

754754
The list of status checks to require in order to merge into this branch. If default is `[]` no status checks are required.
755755

Diff for: README.tfdoc.hcl

+2-2
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ section {
701701
END
702702
}
703703

704-
attribute "contexts" {
704+
attribute "checks" {
705705
type = list(string)
706706
default = []
707707
description = <<-END
@@ -967,7 +967,7 @@ section {
967967
END
968968
}
969969

970-
attribute "contexts" {
970+
attribute "checks" {
971971
type = list(string)
972972
default = []
973973
description = <<-END

Diff for: examples/public-repository/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module "repository" {
6262
6363
required_status_checks = {
6464
strict = true
65-
contexts = ["ci/travis"]
65+
checks = ["ci/travis"]
6666
}
6767
6868
required_pull_request_reviews = {

Diff for: examples/public-repository/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module "repository" {
4848

4949
admin_collaborators = ["terraform-test-user-1"]
5050

51-
branch_protections = [
51+
branch_protections_v5 = [
5252
{
5353
branch = "main"
5454
enforce_admins = true

Diff for: main.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ locals {
5656
for b in local.branch_protections_v3 :
5757
length(keys(b.required_status_checks)) > 0 ? [
5858
merge({
59-
strict = null
60-
contexts = []
59+
strict = null
60+
checks = []
6161
}, b.required_status_checks)] : []
6262
]
6363

@@ -260,8 +260,8 @@ resource "github_branch_protection_v3" "branch_protection" {
260260
for_each = local.required_status_checks[count.index]
261261

262262
content {
263-
strict = required_status_checks.value.strict
264-
contexts = required_status_checks.value.contexts
263+
strict = required_status_checks.value.strict
264+
checks = required_status_checks.value.checks
265265
}
266266
}
267267

Diff for: test/unit-complete/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ module "repository" {
119119
require_signed_commits = true
120120

121121
required_status_checks = {
122-
strict = true
123-
contexts = ["ci/travis"]
122+
strict = true
123+
# checks = ["ci/travis"]
124124
}
125125

126126
required_pull_request_reviews = {

Diff for: variables.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ variable "branch_protections_v3" {
284284
# enforce_admins = bool
285285
# require_signed_commits = bool
286286
# required_status_checks = object({
287-
# strict = bool
288-
# contexts = list(string)
287+
# strict = bool
288+
# checks = list(string)
289289
# })
290290
# required_pull_request_reviews = object({
291291
# dismiss_stale_reviews = bool
@@ -311,7 +311,7 @@ variable "branch_protections_v3" {
311311
#
312312
# required_status_checks = {
313313
# strict = false
314-
# contexts = ["ci/travis"]
314+
# checks = ["ci/travis"]
315315
# }
316316
#
317317
# required_pull_request_reviews = {

0 commit comments

Comments
 (0)