Skip to content

Commit 2d3b8a7

Browse files
authored
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.
1 parent d9c66fa commit 2d3b8a7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/create_release.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,15 @@ def main(args):
5858
branch_name = 'version_' + new_version
5959

6060
# Create a new git branch
61-
subprocess.check_call(['git', 'checkout', '-b', branch_name], cwd=root_dir)
61+
subprocess.check_call(['git', 'checkout', '-b', branch_name, 'origin/main'], cwd=root_dir)
6262

6363
# Create auto-generated changes to the new git branch
6464
subprocess.check_call(['git', 'add', '-u', '.'], cwd=root_dir)
6565
subprocess.check_call(['git', 'commit', '-m', new_version], cwd=root_dir)
66+
print('New release created in branch: `%s`' % branch_name)
6667

67-
print('New relase created in branch: `%s`' % branch_name)
68-
68+
# Push new branch to origin
69+
subprocess.check_call(['git', 'push', 'origin', branch_name], cwd=root_dir)
6970
return 0
7071

7172

0 commit comments

Comments
 (0)