-
Notifications
You must be signed in to change notification settings - Fork 291
fix(ci): add sanity check to build.rs scripts, fixed "detected dubious ownership in repository" errors on git
#4986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4346c7f
13afb72
7282a30
a0cd683
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,16 @@ use std::process::Command; | |
|
|
||
| fn store_git_commit_hash() { | ||
| let output = Command::new("git").args(["rev-parse", "HEAD"]).output().unwrap(); | ||
|
|
||
| // Sanity check on the output. | ||
| if !output.status.success() { | ||
| panic!( | ||
| "Failed to get git commit hash.\nstderr: \n{}\nstdout {}\n", | ||
| String::from_utf8(output.stderr).unwrap_or_default(), | ||
| String::from_utf8(output.stdout).unwrap_or_default(), | ||
| ); | ||
| } | ||
|
|
||
| let git_hash = String::from_utf8(output.stdout).unwrap(); | ||
| println!("cargo:rustc-env=GIT_HASH={git_hash}"); | ||
| } | ||
|
Comment on lines
3
to
17
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: would be nicer to have this defined once in some kind of build utils crate that these three crates will depend on as a build dependency
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the whole
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit postponed to https://github.com/prisma/team-orm/issues/1261 |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.