Skip to content

Commit

Permalink
Have create_release.py push the new branch automatically (#1255)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sbc100 authored Jul 10, 2023
1 parent d9c66fa commit 2d3b8a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/create_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 2d3b8a7

Please sign in to comment.