ssh-agent/paths.js
Kaare Hoff Skovgaard a72777095c
Some checks are pending
/ deployment_keys_demo (macOS-latest) (push) Waiting to run
/ deployment_keys_demo (ubuntu-latest) (push) Waiting to run
/ deployment_keys_demo (windows-latest) (push) Waiting to run
/ docker_demo (push) Waiting to run
Read out HOME instead of the os query info
As when using the gitea-actions-runner on NixOS
it is using systemd dynamic user
2025-06-30 21:05:36 +02:00

30 lines
1 KiB
JavaScript

const os = require("os");
const core = require("@actions/core");
const defaults =
process.env["OS"] != "Windows_NT"
? {
homePath: os.homedir(),
sshAgentCmdDefault: "ssh-agent",
sshAddCmdDefault: "ssh-add",
gitCmdDefault: "git",
}
: {
// Assuming GitHub hosted `windows-*` runners for now
homePath: os.homedir(),
sshAgentCmdDefault: "c://progra~1//git//usr//bin//ssh-agent.exe",
sshAddCmdDefault: "c://progra~1//git//usr//bin//ssh-add.exe",
gitCmdDefault: "c://progra~1//git//bin//git.exe",
};
const sshAgentCmdInput = core.getInput("ssh-agent-cmd");
const sshAddCmdInput = core.getInput("ssh-add-cmd");
const gitCmdInput = core.getInput("git-cmd");
module.exports = {
homePath: defaults.homePath,
sshAgentCmd:
sshAgentCmdInput !== "" ? sshAgentCmdInput : defaults.sshAgentCmdDefault,
sshAddCmd: sshAddCmdInput !== "" ? sshAddCmdInput : defaults.sshAddCmdDefault,
gitCmd: gitCmdInput !== "" ? gitCmdInput : defaults.gitCmdDefault,
};