Apply all_repos rulesets to private GitHub repos
This commit is contained in:
@@ -87,8 +87,8 @@ run "private_repo_defaults" {
|
||||
}
|
||||
|
||||
assert {
|
||||
condition = length(module.ruleset) == 0 && module.repository["secret"].codeowners != null
|
||||
error_message = "private repo silently skips all_repos rulesets but still gets CODEOWNERS"
|
||||
condition = keys(module.ruleset) == ["secret/branch-protection", "secret/ref-names-tag", "secret/tag-protection"] && module.repository["secret"].codeowners != null
|
||||
error_message = "private repo gets all_repos rulesets and CODEOWNERS"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,16 +146,19 @@ run "exclusions_and_custom_rulesets" {
|
||||
}
|
||||
}
|
||||
|
||||
run "private_rulesets_rejected" {
|
||||
run "private_repo_custom_rulesets" {
|
||||
command = plan
|
||||
|
||||
variables {
|
||||
repository = {
|
||||
secret = { name = "secret", rulesets = ["signed"] }
|
||||
secret = { name = "secret", rulesets = ["signed"], exclude_rulesets = ["branch-protection", "tag-protection"] }
|
||||
}
|
||||
}
|
||||
|
||||
expect_failures = [var.repository]
|
||||
assert {
|
||||
condition = keys(module.ruleset) == ["secret/ref-names-tag", "secret/signed"]
|
||||
error_message = "private repo may list rulesets"
|
||||
}
|
||||
}
|
||||
|
||||
run "mandatory_exclusion_rejected" {
|
||||
|
||||
Reference in New Issue
Block a user