diff --git a/src/utils/env/addEnv.ts b/src/utils/env/addEnv.ts index 32102d57..7151a538 100644 --- a/src/utils/env/addEnv.ts +++ b/src/utils/env/addEnv.ts @@ -3,8 +3,6 @@ import * as core from "@actions/core" import { isGitHubCI } from "./isci" import { untildify_user as untildify } from "../path/untildify" import { appendFileSync } from "fs" -import { join } from "path" -import { isRoot } from "./sudo" import { error } from "../io/io" import { execPowershell } from "../exec/powershell" @@ -39,12 +37,7 @@ function addEnvSystem(name: string, valGiven: string | undefined) { case "linux": case "darwin": { // find profile path - let profile_path = untildify(".profile") - if (isRoot() && typeof process.env.SUDO_USER === "string") { - // use the user profile even if root - profile_path = join("/home/", process.env.SUDO_USER, ".profile") - } - + const profile_path = untildify(".profile") appendFileSync(profile_path, `\nexport ${name}="${val}"\n`) core.info(`${name}="${val} was added to "${profile_path}"`) return