Fix github CI branch name (#1396)
* Fix github CI branch name * Check git branch * New git command * Use GITHUB_HEAD_REF if it exists
This commit is contained in:
parent
b881385e3b
commit
237e97f033
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue