From 8044f31fdaad3f55092764fb972aac69e15fef0a Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Wed, 6 Mar 2024 13:41:50 -0500 Subject: [PATCH] create_release.py: Add option for alternate Git URL Signed-off-by: Bryan Gurney --- release_management/create_release.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/release_management/create_release.py b/release_management/create_release.py index f1521b0..64c2f33 100755 --- a/release_management/create_release.py +++ b/release_management/create_release.py @@ -226,10 +226,12 @@ def tag_rust_library(namespace, name): if namespace.no_release: return - dry_run_caller( - "__main__._push_tag", lambda: _push_tag(repository.geturl(), tag) + push_git_url = ( + repository.geturl() if namespace.git_repo is None else namespace.git_repo ) + dry_run_caller("__main__._push_tag", lambda: _push_tag(push_git_url, tag)) + dry_run_caller( "__main__.create_release", lambda: create_release( @@ -317,10 +319,12 @@ def tag_python_library(namespace, name): if namespace.no_release: return - dry_run_caller( - "__main__._push_tag", lambda: _push_tag(repository.geturl(), tag) + push_git_url = ( + repository.geturl() if namespace.git_repo is None else namespace.git_repo ) + dry_run_caller("__main__._push_tag", lambda: _push_tag(push_git_url, tag)) + changelog_url = get_changelog_url(repository.geturl(), get_branch()) dry_run_caller( @@ -425,6 +429,12 @@ def _get_parser(): help="stop before pushing any changes to GitHub repo", ) + parser.add_argument( + "--git-repo", + dest="git_repo", + help="Use alternate Git repository URL for tag push", + ) + subparsers = parser.add_subparsers(title="subcommands", required=True) rust_subparser = subparsers.add_parser(