Fixup GHA home directory on Mac (#482)

This commit is contained in:
Ana Hobden 2023-05-26 13:16:31 -07:00 committed by GitHub
parent e0cc66038a
commit 464ac0776e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -154,7 +154,11 @@ impl ConfigureShellProfile {
let mut buf = "/nix/var/nix/profiles/default/bin\n".to_string();
// Actions runners operate as `runner` user by default
if let Ok(Some(runner)) = User::from_name("runner") {
buf += &format!("/home/{}/.nix-profile/bin\n", runner.name);
#[cfg(target_os = "linux")]
let path = format!("/home/{}/.nix-profile/bin\n", runner.name);
#[cfg(target_os = "macos")]
let path = format!("/Users/{}/.nix-profile/bin\n", runner.name);
buf += &path;
}
create_or_insert_files.push(
CreateOrInsertIntoFile::plan(