Skip to content

Commit 837e7ff

Browse files
committed
Default to the template repo name for the new repo name.
1 parent 01af027 commit 837e7ff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

management_instance/runbooks/shared_scripts/fork_repo_github.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def init_argparse():
8989
parser.add_argument('--new-project-name', action='store',
9090
default=get_octopusvariable_quiet(
9191
'ForkGithubRepo.Exported.Project.Name') or get_octopusvariable_quiet(
92-
'Exported.Project.Name') or get_octopusvariable_quiet('Octopus.Project.Name'))
92+
'Exported.Project.Name'))
9393
parser.add_argument('--github-app-id', action='store',
9494
default=get_octopusvariable_quiet(
9595
'ForkGithubRepo.GitHub.App.Id') or get_octopusvariable_quiet('GitHub.App.Id'))
@@ -310,7 +310,8 @@ def ensure_git_exists():
310310
template_repo = parser.template_repo_name.strip()
311311
new_repo_custom_prefix = re.sub('[^a-zA-Z0-9]', '_', parser.new_repo_name_prefix.strip())
312312
tenant_name_sanitized = re.sub('[^a-zA-Z0-9]', '_', parser.tenant_name.strip())
313-
project_name_sanitized = re.sub('[^a-zA-Z0-9]', '_', parser.new_project_name.strip())
313+
project_name_sanitized = re.sub('[^a-zA-Z0-9]', '_',
314+
parser.new_project_name.strip() if parser.new_project_name.strip() else template_repo)
314315

315316
# The new repo is prefixed either with the custom prefix or the tenant name if no custom prefix is defined
316317
new_repo_prefix = new_repo_custom_prefix if len(new_repo_custom_prefix) != 0 else tenant_name_sanitized

0 commit comments

Comments
 (0)