- Notifications
You must be signed in to change notification settings - Fork286
Description
I see a few open issues that look similar to this, but not exactly the same, so I figured I'd open a new issue. Feel free to close if this is a duplicate.
For example, this might be a duplicate of#148.
Version info
I am able to reproduce this bug using version v0.9.0 (dc588b6) of this action.
Description of the bug
On Windows, I am unable to clone, with the error message looking something like this:
ssh: Could not resolve hostname key-<SHA>.github.com: Name or service not knownfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.I've only encountered this bug on Windows. I have not seen this bug on Linux or macOS.
I do not have any Git submodules.
Workaround
I'm able to resolve the bug by setting theGIT_SSH_COMMAND environment variable as follows:
-name:Set GIT_SSH_COMMAND on Windowsif:runner.os == 'Windows'shell:bashrun:| echo "GIT_SSH_COMMAND=ssh -F /c/Users/MY_USERNAME/.ssh/config -o \"UserKnownHostsFile /c/Users/MY_USERNAME/.ssh/known_hosts\"" >> "${GITHUB_ENV:?}"
Replace/c/Users/MY_USERNAME/ with the correct home directory. On GitHub-hosted Windows runners, this will probably be/c/Users/runneradmin. For self-hosted Windows runners, this will depend on your CI setup.