6f828ccb51
On my self-hosted Windows runners, the `git`, `ssh-agent`, and `ssh-add` commands are not located in the locations that are currently hard-coded in `paths.js`. With this PR, I am able to get this action to work on my runners as follows: ```yaml - uses: webfactory/ssh-agent@... with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} git-cmd: git ssh-agent-cmd: ssh-agent ssh-add-cmd: ssh-add ```
16 lines
657 B
JavaScript
16 lines
657 B
JavaScript
const os = require('os');
|
|
|
|
module.exports = (process.env['OS'] != 'Windows_NT') ? {
|
|
// Use getent() system call, since this is what ssh does; makes a difference in Docker-based
|
|
// Action runs, where $HOME is different from the pwent
|
|
homePath: os.userInfo().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'
|
|
};
|