summaryrefslogtreecommitdiffhomepage
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rwxr-xr-xsource/metadata.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/metadata.py b/source/metadata.py
index 9700ed59..72133e5e 100755
--- a/source/metadata.py
+++ b/source/metadata.py
@@ -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: