Skip to content

Commit

Permalink
Avoid invalid repository name
Browse files Browse the repository at this point in the history
See mineiros-io#161

Signed-off-by: Benoit Donneaux <[email protected]>
  • Loading branch information
btlogy committed Jul 21, 2023
1 parent ee6001a commit da702c1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
variable "name" {
description = "(Required) The name of the repository."
type = string
validation {
# Avoid partial creation of repo
# https://github.com/mineiros-io/terraform-github-repository/issues/161
# TODO: consider remove this when the provider handles it
# https://github.com/integrations/terraform-provider-github/issues/1215
condition = can(regex("^[a-zA-Z0-9_.]+$", var.name))
error_message = "The name value must be a valid GitHub repository name."
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit da702c1

Please sign in to comment.