diff options
author | Ivan Zorin <[email protected]> | 2023-08-07 02:05:04 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2023-08-07 09:05:04 +1000 |
commit | 8b90666f305cd9b434a4d25690da8bea1937186d (patch) | |
tree | c728e0cb708f434c4daae0ae7d962b5bef194e03 | |
parent | c03e1842aa7cfd773b86e7b3b6fb26b8d976ae4d (diff) | |
download | IronOS-8b90666f305cd9b434a4d25690da8bea1937186d.tar.gz IronOS-8b90666f305cd9b434a4d25690da8bea1937186d.zip |
metadata.py: update tagging considering github CI builds (#1782)
-rwxr-xr-x | source/metadata.py | 5 |
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: |