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.
This commit is contained in:
Sam Clegg
2023-07-10 14:03:32 -07:00
committed by GitHub
parent d9c66fa2c2
commit 2d3b8a743e

View File

@@ -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