From 8f4e36f75d11e2043505f312d44ddfbfeda399bf Mon Sep 17 00:00:00 2001
From: Brandon Clayton <bclayton@usgs.gov>
Date: Wed, 20 Apr 2022 16:23:54 -0600
Subject: [PATCH] check branch env var

---
 gradle/app-version.gradle | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gradle/app-version.gradle b/gradle/app-version.gradle
index a5baa6409..2367ef400 100644
--- a/gradle/app-version.gradle
+++ b/gradle/app-version.gradle
@@ -6,8 +6,9 @@ tasks.withType(JavaCompile) {
     new File(versionFile.getParent()).mkdirs()
     def details = versionDetails()
     def ciProjectUrl = System.getenv("CI_PROJECT_URL")
+    def branch = System.getenv("CI_COMMIT_BRANCH")
     def versionInfo = [
-      branchName: details.branchName,
+      branchName: branch ? branch : details.branchName,
       commitDistance: details.commitDistance,
       gitHash:  details.gitHash,
       gitHashFull:  details.gitHashFull,
-- 
GitLab