From 3720ef838dea7207cfe2f8d5d7298befa9c9da3c Mon Sep 17 00:00:00 2001 From: decentral1se Date: Sat, 3 Apr 2021 20:28:31 +0200 Subject: [PATCH] Track branch state when parsing versions --- bin/app-json.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/app-json.py b/bin/app-json.py index ebebcc8..97e9675 100755 --- a/bin/app-json.py +++ b/bin/app-json.py @@ -151,6 +151,8 @@ def get_app_versions(app_path): log.info(f"No tags discovered, moving on") return {} + initial_branch = _run_cmd("git rev-parse --abbrev-ref HEAD") + for tag in tags: _run_cmd(f"git checkout {tag}") @@ -186,7 +188,7 @@ def get_app_versions(app_path): versions[tag] = service_versions - _run_cmd("git checkout HEAD") + _run_cmd(f"git checkout {initial_branch}") return versions