add fork_from to github repositories
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful

This commit is contained in:
2026-11-19 22:19:47 +11:00
parent 8144ddb1d2
commit 3198f8d5d1
4 changed files with 63 additions and 4 deletions
+6
View File
@@ -108,9 +108,15 @@ variable "repository" {
delete_branch_on_merge = optional(bool, true)
rulesets = optional(list(string), [])
exclude_rulesets = optional(list(string), [])
fork_from = optional(string)
}))
default = {}
validation {
condition = alltrue([for repo in var.repository : repo.fork_from == null || can(regex("^[^/]+/[^/]+$", repo.fork_from))])
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 : 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)])}."