Skip to content

Commit

Permalink
Allow overwriting tags
Browse files Browse the repository at this point in the history
honestly, how did I miss it?
  • Loading branch information
mini-bomba committed Jun 21, 2022
1 parent 2ccd6c5 commit 326668d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,15 @@ def get_boolean(key: str) -> bool:

# Create/move tag
print("::group::🏷️ Creating/Moving the tag...")
gitproc = subprocess.Popen(["git", "tag", tag_name, target_commit], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
gitproc = subprocess.Popen(["git", "tag", "-f" tag_name, target_commit],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out, _ = gitproc.communicate()
print("::stop-commands::git-output")
print(out.decode())
if gitproc.returncode != 0:
print("::git-output::")
print("::endgroup::")
print(f"::error::❌ Command 'git tag {tag_name} {target_commit}' returned with non-zero exit code!")
print(f"::error::❌ Command 'git tag -f {tag_name} {target_commit}' returned with non-zero exit code!")
exit(gitproc.returncode)
gitproc = subprocess.Popen(["git", "push", "--force", "origin", tag_name], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out, _ = gitproc.communicate()
Expand Down

0 comments on commit 326668d

Please sign in to comment.