Skip to content

Commit 2ca62d8

Browse files
committed
Allow dashes in repo names
1 parent 85ae1e9 commit 2ca62d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

management_instance/runbooks/shared_scripts/fork_repo_github.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def init_argparse():
118118
parser.add_argument('--template-repo-name', action='store',
119119
default=get_octopusvariable_quiet(
120120
'ForkGithubRepo.Original.Project.Name') or
121-
re.sub('[^a-zA-Z0-9]', '_', get_octopusvariable_quiet('Octopus.Project.Name')))
121+
re.sub('[^a-zA-Z0-9-]', '_', get_octopusvariable_quiet('Octopus.Project.Name')))
122122
parser.add_argument('--mainline-branch',
123123
action='store',
124124
default=get_octopusvariable_quiet(
@@ -308,9 +308,9 @@ def ensure_git_exists():
308308

309309
cac_org = parser.git_organization.strip()
310310
template_repo = parser.template_repo_name.strip()
311-
new_repo_custom_prefix = re.sub('[^a-zA-Z0-9]', '_', parser.new_repo_name_prefix.strip())
312-
tenant_name_sanitized = re.sub('[^a-zA-Z0-9]', '_', parser.tenant_name.strip())
313-
project_name_sanitized = re.sub('[^a-zA-Z0-9]', '_',
311+
new_repo_custom_prefix = re.sub('[^a-zA-Z0-9-]', '_', parser.new_repo_name_prefix.strip())
312+
tenant_name_sanitized = re.sub('[^a-zA-Z0-9-]', '_', parser.tenant_name.strip())
313+
project_name_sanitized = re.sub('[^a-zA-Z0-9-]', '_',
314314
parser.new_project_name.strip() if parser.new_project_name.strip() else template_repo)
315315

316316
# The new repo is prefixed either with the custom prefix or the tenant name if no custom prefix is defined

0 commit comments

Comments
 (0)