mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
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:
@@ -17,6 +17,9 @@ fn main() {
|
|||||||
// They are accessed with the `env!("...")` macro in the codebase.
|
// 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_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_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);
|
println!("cargo:rustc-env=GRAPHITE_RELEASE_SERIES={}", GRAPHITE_RELEASE_SERIES);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user