Skip to content

Commit

Permalink
adjust bump script
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov-aws committed Nov 18, 2023
1 parent ef0865f commit 11048ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bump-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import sys
from cid._version import __version__ as old_ver

os.system('git checkout main')

Check failure

Code scanning / CodeGuru Reviewer Scanner

Outdated subprocess module API High

This line of code makes an outdated API call to start and communicate with processes. We recommend that you use the subprocess module to start new processes, connect with their pipes, and get their return codes.

Learn more

Similar issue at line numbers 6, 21, and 33.

Check failure

Code scanning / CodeGuru Reviewer Scanner

OS command injection High

Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell https://bandit.readthedocs.io/en/latest/plugins/b605\_start\_process\_with\_a\_shell.html

Check failure

Code scanning / CodeGuru Reviewer Scanner

OS command injection High

os.system('git pull')

Check failure

Code scanning / CodeGuru Reviewer Scanner

OS command injection High

Check failure

Code scanning / CodeGuru Reviewer Scanner

OS command injection High

Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell https://bandit.readthedocs.io/en/latest/plugins/b605\_start\_process\_with\_a\_shell.html

bump='patch'
if len(sys.argv)>1 :
Expand All @@ -16,6 +18,8 @@
else:
raise NotImplementedError('only patch and minor are implemented')

os.system(f"git checkout -b 'release/{new_ver}'")


tx = open('cid/_version.py').read()
with open('cid/_version.py', "w") as f:
Expand All @@ -27,4 +31,5 @@


os.system('git diff HEAD --unified=0')
print('to undo:\n git checkout HEAD -- cfn-templates/cid-cfn.yml cid/_version.py')
print('to undo:\n git checkout HEAD -- cfn-templates/cid-cfn.yml cid/_version.py')
print(f"to continue:\n git commit -am 'release {new_ver}'; git push origin 'release/{new_ver}'")

0 comments on commit 11048ae

Please sign in to comment.