From 3ebfac184f6fd12781d64ee92981025b0a19b853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Spie=C3=9F?= Date: Mon, 19 Jun 2023 15:54:18 +0200 Subject: [PATCH] Improve build file to handle github action commit hash --- build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5a143e0dc9..8c07cee22d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -45,12 +45,12 @@ val isCI = System.getProperty("BUILD_NUMBER") != null // jenkins || System.getenv("BUILD_NUMBER") != null || System.getProperty("GIT_COMMIT") != null // jitpack || System.getenv("GIT_COMMIT") != null - || System.getProperty("GITHUB_ACTIONS") != null // Github Actions - || System.getenv("GITHUB_ACTIONS") != null + || System.getProperty("GITHUB_ACTION") != null // Github Actions + || System.getenv("GITHUB_ACTION") != null // Check the commit hash and version information val commitHash: String by lazy { - val commit = System.getenv("GIT_COMMIT") ?: System.getProperty("GIT_COMMIT") + val commit = System.getenv("GIT_COMMIT") ?: System.getProperty("GIT_COMMIT") ?: System.getenv("GITHUB_SHA") // We only set the commit hash on CI builds since we don't want dirty local repos to set a wrong commit if (isCI && commit != null) commit.substring(0, 7)