scope GitHub App secret to the github unit, use team slugs
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
mock_provider "github" {}
|
||||
mock_provider "github" {
|
||||
mock_resource "github_team" {
|
||||
defaults = { slug = "maintainers-slug" }
|
||||
}
|
||||
}
|
||||
|
||||
variables {
|
||||
owner = "IUCLabs"
|
||||
@@ -20,8 +24,8 @@ run "public_repo_with_ruleset" {
|
||||
}
|
||||
|
||||
assert {
|
||||
condition = github_repository_file.codeowners[".github"].content == "* @IUCLabs/maintainers @carol\n"
|
||||
error_message = "CODEOWNERS must list maintainers, teams qualified by owner"
|
||||
condition = github_repository_file.codeowners[".github"].content == "* @IUCLabs/maintainers-slug @carol\n"
|
||||
error_message = "CODEOWNERS must list maintainers, teams by owner-qualified slug"
|
||||
}
|
||||
|
||||
assert {
|
||||
@@ -35,6 +39,21 @@ run "public_repo_with_ruleset" {
|
||||
}
|
||||
}
|
||||
|
||||
run "no_codeowners_without_auto_init" {
|
||||
command = plan
|
||||
|
||||
variables {
|
||||
repository = {
|
||||
empty = { name = "empty", private = false, auto_init = false, maintainers = ["@maintainers"] }
|
||||
}
|
||||
}
|
||||
|
||||
assert {
|
||||
condition = length(github_repository_file.codeowners) == 0
|
||||
error_message = "CODEOWNERS needs an initialised default branch"
|
||||
}
|
||||
}
|
||||
|
||||
run "private_repo_with_ruleset_rejected" {
|
||||
command = plan
|
||||
|
||||
|
||||
Reference in New Issue
Block a user