9ab540719e
Express a fork as an optional fork_from key on the repository yaml, so a forked repo is declared the same way as any other repo. - add fork_from "<owner>/<repo>" to the repository module and object type - create gitea_fork instead of gitea_repository when fork_from is set - validate the source repo name matches the config file name, since a fork inherits the source name - move gitea_repository.this to index 0 for the count refactor - index existing repository import targets to match
144 lines
2.3 KiB
Terraform
144 lines
2.3 KiB
Terraform
variable "name" {
|
|
type = string
|
|
}
|
|
|
|
variable "organisation" {
|
|
type = string
|
|
}
|
|
|
|
variable "fork_from" {
|
|
description = "Source repository to fork, as \"<owner>/<repo>\". When set, a fork is created instead of a new repository."
|
|
type = string
|
|
default = null
|
|
|
|
validation {
|
|
condition = var.fork_from == null || can(regex("^[^/]+/[^/]+$", var.fork_from))
|
|
error_message = "fork_from must be \"<owner>/<repo>\"."
|
|
}
|
|
|
|
validation {
|
|
condition = var.fork_from == null || try(split("/", var.fork_from)[1], null) == var.name
|
|
error_message = "fork_from source repository must be named \"${var.name}\": a fork inherits the source name, so it cannot differ from the config file name."
|
|
}
|
|
}
|
|
|
|
variable "description" {
|
|
type = string
|
|
default = null
|
|
}
|
|
|
|
variable "private" {
|
|
type = bool
|
|
default = null
|
|
}
|
|
|
|
variable "default_branch" {
|
|
type = string
|
|
default = null
|
|
}
|
|
|
|
variable "has_issues" {
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
variable "has_wiki" {
|
|
type = bool
|
|
default = false
|
|
}
|
|
|
|
variable "has_pull_requests" {
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
variable "has_projects" {
|
|
type = bool
|
|
default = false
|
|
}
|
|
|
|
variable "allow_merge_commits" {
|
|
type = bool
|
|
default = false
|
|
}
|
|
|
|
variable "allow_rebase" {
|
|
type = bool
|
|
default = false
|
|
}
|
|
|
|
variable "allow_rebase_explicit" {
|
|
type = bool
|
|
default = false
|
|
}
|
|
|
|
variable "allow_squash_merge" {
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
variable "archived" {
|
|
type = bool
|
|
default = null
|
|
}
|
|
|
|
variable "repo_template" {
|
|
type = bool
|
|
default = null
|
|
}
|
|
|
|
variable "website" {
|
|
type = string
|
|
default = null
|
|
}
|
|
|
|
variable "autodetect_manual_merge" {
|
|
type = bool
|
|
default = null
|
|
}
|
|
|
|
variable "mirror" {
|
|
type = bool
|
|
default = null
|
|
}
|
|
|
|
variable "migration_clone_address" {
|
|
type = string
|
|
default = null
|
|
}
|
|
|
|
variable "migration_service" {
|
|
type = string
|
|
default = null
|
|
}
|
|
|
|
variable "migration_mirror_interval" {
|
|
type = string
|
|
default = null
|
|
}
|
|
|
|
variable "migration_lfs" {
|
|
type = bool
|
|
default = null
|
|
}
|
|
|
|
variable "migration_lfs_endpoint" {
|
|
type = string
|
|
default = null
|
|
}
|
|
|
|
variable "migration_issue_labels" {
|
|
type = bool
|
|
default = null
|
|
}
|
|
|
|
variable "migration_milestones" {
|
|
type = bool
|
|
default = null
|
|
}
|
|
|
|
variable "migration_releases" {
|
|
type = bool
|
|
default = null
|
|
}
|