Skip to content

Commit

Permalink
metadata.py: update tagging considering github CI builds (#1782)
Browse files Browse the repository at this point in the history
  • Loading branch information
ia authored Aug 6, 2023
1 parent c03e184 commit 8b90666
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def load_json(filename: str):
return json.loads(f.read())

def read_git_tag():
return f"{subprocess.check_output(['git', 'rev-parse', '--short=7', 'HEAD']).strip().decode('ascii').upper()}"
if os.environ.get("GITHUB_CI_PR_SHA", "") != "":
return os.environ["GITHUB_CI_PR_SHA"][:7].upper()
else:
return f"{subprocess.check_output(['git', 'rev-parse', '--short=7', 'HEAD']).strip().decode('ascii').upper()}"

def read_version():
with open(HERE / "version.h") as version_file:
Expand Down

0 comments on commit 8b90666

Please sign in to comment.