From 237e97f03379d93d9e6058e6efdcfc69c269996b Mon Sep 17 00:00:00 2001 From: 0HyperCube <78500760+0HyperCube@users.noreply.github.com> Date: Wed, 23 Aug 2023 16:17:32 +0100 Subject: [PATCH] Fix github CI branch name (#1396) * Fix github CI branch name * Check git branch * New git command * Use GITHUB_HEAD_REF if it exists --- editor/build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/editor/build.rs b/editor/build.rs index 85c45611..ef3c4f9d 100644 --- a/editor/build.rs +++ b/editor/build.rs @@ -17,6 +17,9 @@ fn main() { // They are accessed with the `env!("...")` macro in the codebase. println!("cargo:rustc-env=GRAPHITE_GIT_COMMIT_DATE={}", git_command(&["log", "-1", "--format=%cd"])); println!("cargo:rustc-env=GRAPHITE_GIT_COMMIT_HASH={}", git_command(&["rev-parse", "HEAD"])); - println!("cargo:rustc-env=GRAPHITE_GIT_COMMIT_BRANCH={}", git_command(&["rev-parse", "--abbrev-ref", "HEAD"])); + println!( + "cargo:rustc-env=GRAPHITE_GIT_COMMIT_BRANCH={}", + std::env::var("GITHUB_HEAD_REF").unwrap_or_else(|_| git_command(&["name-rev", "--name-only", "HEAD"])) + ); println!("cargo:rustc-env=GRAPHITE_RELEASE_SERIES={}", GRAPHITE_RELEASE_SERIES); }