mirror of
https://github.com/webfactory/ssh-agent.git
synced 2025-06-28 05:33:45 +00:00
Provide gitPath
for Windows to avoid failures on windows-2022
(GitHub-hosted runner) (#137)
### Problem: Observed error on `windows-2022` ([GitHub-hosted runner](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources)) that `git` command cannot be found. ### Issue: Cannot find git executable on on windows-2022 (GitHub-hosted runner) #136 ### Solution: This path improvement makes use of existing `path.js` to resolve and return correct `git.exe` path for Windows, leaving the executable name as it was for other operating systems. ### Caveats: No idea how and why this `c://progra~1//git//usr//bin//git.exe` mumbo-jumbo works but it apparently did for other executables so figured it should work for `git.exe` (and it does).
This commit is contained in:
parent
fbef2c7bd0
commit
df2f741a87
5 changed files with 49 additions and 55 deletions
|
@ -1,11 +1,11 @@
|
|||
const core = require('@actions/core');
|
||||
const { execFileSync } = require('child_process');
|
||||
const { sshAgent } = require('./paths.js');
|
||||
const { sshAgentCmd } = require('./paths.js');
|
||||
|
||||
try {
|
||||
// Kill the started SSH agent
|
||||
console.log('Stopping SSH agent');
|
||||
execFileSync(sshAgent, ['-k'], { stdio: 'inherit' });
|
||||
execFileSync(sshAgentCmd, ['-k'], { stdio: 'inherit' });
|
||||
} catch (error) {
|
||||
console.log(error.message);
|
||||
console.log('Error stopping the SSH agent, proceeding anyway');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue