From 464ac0776e1b318270e0848667d99a44033fe9d4 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Fri, 26 May 2023 13:16:31 -0700 Subject: [PATCH] Fixup GHA home directory on Mac (#482) --- src/action/common/configure_shell_profile.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/action/common/configure_shell_profile.rs b/src/action/common/configure_shell_profile.rs index f552b0d..d99c605 100644 --- a/src/action/common/configure_shell_profile.rs +++ b/src/action/common/configure_shell_profile.rs @@ -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(