From 2d3b8a743ebd881a0f53d6067adccccdb71d3b2f Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Mon, 10 Jul 2023 14:03:32 -0700 Subject: [PATCH] Have create_release.py push the new branch automatically (#1255) Having used this script for a while now I'm not sure there is any point if leaving this last step as a manual push. --- scripts/create_release.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/create_release.py b/scripts/create_release.py index a7438f2cc1..418dcabae0 100755 --- a/scripts/create_release.py +++ b/scripts/create_release.py @@ -58,14 +58,15 @@ def main(args): branch_name = 'version_' + new_version # Create a new git branch - subprocess.check_call(['git', 'checkout', '-b', branch_name], cwd=root_dir) + subprocess.check_call(['git', 'checkout', '-b', branch_name, 'origin/main'], cwd=root_dir) # Create auto-generated changes to the new git branch subprocess.check_call(['git', 'add', '-u', '.'], cwd=root_dir) subprocess.check_call(['git', 'commit', '-m', new_version], cwd=root_dir) + print('New release created in branch: `%s`' % branch_name) - print('New relase created in branch: `%s`' % branch_name) - + # Push new branch to origin + subprocess.check_call(['git', 'push', 'origin', branch_name], cwd=root_dir) return 0