-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide
gitPath
for Windows to avoid failures on windows-2022
(Gi…
…tHub-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).
- Loading branch information
Showing
5 changed files
with
49 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
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 | ||
home: os.userInfo().homedir, | ||
sshAgent: 'ssh-agent', | ||
sshAdd: 'ssh-add' | ||
|
||
homePath: os.userInfo().homedir, | ||
sshAgentCmd: 'ssh-agent', | ||
sshAddCmd: 'ssh-add', | ||
gitCmd: 'git' | ||
} : { | ||
|
||
home: os.homedir(), | ||
sshAgent: 'c://progra~1//git//usr//bin//ssh-agent.exe', | ||
sshAdd: 'c://progra~1//git//usr//bin//ssh-add.exe' | ||
|
||
// Assuming GitHub hosted `windows-*` runners for now | ||
homePath: os.homedir(), | ||
sshAgentCmd: 'c://progra~1//git//usr//bin//ssh-agent.exe', | ||
sshAddCmd: 'c://progra~1//git//usr//bin//ssh-add.exe', | ||
gitCmd: 'c://progra~1//git//usr//bin//git.exe' | ||
}; | ||
|