Skip to content

Commit

Permalink
chore(scm): add more information to GHA warning (#9273)
Browse files Browse the repository at this point in the history
### Description

Add what we failed to resolve along with the error message.

### Testing Instructions

👀
  • Loading branch information
chris-olszewski authored Oct 16, 2024
1 parent de75ae3 commit cf6e98c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions crates/turborepo-scm/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,18 @@ impl Git {
// because at this point we know we're in a GITHUB CI environment
// and we should really know by now what the base ref is
// so it's better to just error if something went wrong
return if self
.execute_git_command(&["rev-parse", &github_base_ref], "")
.is_ok()
{
eprintln!("Resolved base ref from GitHub Actions event: {github_base_ref}");
Ok(github_base_ref)
} else {
eprintln!("Failed to resolve base ref from GitHub Actions event");
Err(Error::UnableToResolveRef)
return match self.execute_git_command(&["rev-parse", &github_base_ref], "") {
Ok(_) => {
eprintln!("Resolved base ref from GitHub Actions event: {github_base_ref}");
Ok(github_base_ref)
}
Err(e) => {
eprintln!(
"Failed to resolve base ref '{github_base_ref}' from GitHub Actions \
event: {e}"
);
Err(Error::UnableToResolveRef)
}
};
}

Expand Down

0 comments on commit cf6e98c

Please sign in to comment.