keep fork default branch and CODEOWNERS, reject private forks
This commit is contained in:
@@ -100,7 +100,7 @@ variable "repository" {
|
||||
type = map(object({
|
||||
name = string
|
||||
description = optional(string, "")
|
||||
private = optional(bool, true)
|
||||
private = optional(bool)
|
||||
default_branch = optional(string, "main")
|
||||
maintainers = optional(list(string), [])
|
||||
codeowners = optional(list(string), [])
|
||||
@@ -117,6 +117,11 @@ variable "repository" {
|
||||
error_message = "fork_from must be \"<owner>/<repo>\": ${join(", ", [for name, repo in var.repository : name if repo.fork_from != null && !can(regex("^[^/]+/[^/]+$", coalesce(repo.fork_from, "-")))])}."
|
||||
}
|
||||
|
||||
validation {
|
||||
condition = alltrue([for repo in var.repository : !(repo.fork_from != null && repo.private == true)])
|
||||
error_message = "private cannot be set on a fork, its visibility follows the source: ${join(", ", [for name, repo in var.repository : name if repo.fork_from != null && repo.private == true])}."
|
||||
}
|
||||
|
||||
validation {
|
||||
condition = alltrue([for repo in var.repository : contains(["squash", "merge", "rebase"], repo.merge_type)])
|
||||
error_message = "merge_type must be squash, merge or rebase: ${join(", ", [for name, repo in var.repository : name if !contains(["squash", "merge", "rebase"], repo.merge_type)])}."
|
||||
|
||||
Reference in New Issue
Block a user