Skip to content

Commit 6e5763c

Browse files
committed
chore: Add test for v4 branch protections
1 parent 31c2492 commit 6e5763c

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

test/unit-complete/main.tf

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,31 @@ module "repository" {
8686
secret = var.webhook_secret
8787
}]
8888

89-
branch_protections = [
89+
branch_protections_v4 = [
90+
{
91+
pattern = "staging"
92+
93+
allows_deletions = false
94+
allows_force_pushes = false
95+
blocks_creations = false
96+
enforce_admins = true
97+
require_conversation_resolution = true
98+
require_signed_commits = true
99+
required_linear_history = true
100+
101+
required_pull_request_reviews = {
102+
dismiss_stale_reviews = true
103+
require_code_owner_reviews = true
104+
required_approving_review_count = 1
105+
}
106+
107+
required_status_checks = {
108+
strict = true
109+
}
110+
}
111+
]
112+
113+
branch_protections_v3 = [
90114
{
91115
branch = "main"
92116
enforce_admins = true

test/unit-complete/provider.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ terraform {
55

66
required_providers {
77
github = {
8-
source = "integrations/github"
9-
version = "~> 5.0, !=5.3.0, !=5.4.0, !=5.5.0"
8+
source = "integrations/github"
9+
# mask providers with broken branch protection v3 imlementation
10+
version = "~> 5.0, !=5.3.0, !=5.4.0, !=5.5.0, !=5.6.0, !=5.7.0"
1011
}
1112
tls = {
1213
source = "hashicorp/tls"

0 commit comments

Comments
 (0)