Skip to content

Commit

Permalink
Merge pull request #629 from KipK/build_version
Browse files Browse the repository at this point in the history
add branch name to local build_version
  • Loading branch information
jeremypoulter authored May 6, 2023
2 parents f5f3404 + ec07867 commit 290528a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/auto_fw_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
def get_build_flag():
ret = subprocess.run(["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE, text=True) #Uses any tags
full_hash = ret.stdout.strip()
ret = subprocess.run(["git", "symbolic-ref", "--short", "HEAD"], stdout=subprocess.PIPE, text=True) # retrieve branch name
branch = ret.stdout.strip()
short_hash = full_hash[:8]

build_version = "local_" + short_hash
build_version = "local_" + branch + "_" + short_hash

# get the GITHUB_REF_NAME
ref_name = os.environ.get('GITHUB_REF_NAME')
Expand Down

0 comments on commit 290528a

Please sign in to comment.