Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh-agent does not work with backslashed path seperator on windows machine #162

Open
shelper opened this issue Feb 8, 2023 · 1 comment

Comments

@shelper
Copy link

shelper commented Feb 8, 2023

I have an action script that uses ssh-agent, and it works fine on ubuntu for access private repo using deploy key, but failed on windows,
the error message is

Load key "C:\\Users\\runneradmin/.ssh/key-52016bfd3f72432689e062517edb001705ef0a8d1af12eb63b188417c75ca43e": invalid format

and i believe the reason is that windows just cannot load key with / as its path seperator, we need to change / to \\ to make it work on windows. e.g. the key file path should be:
C:\Users\runneradmin\.ssh\key-52016bfd3f72432689e062517edb001705ef0a8d1af12eb63b188417c75ca43e

@cardoe
Copy link

cardoe commented Mar 7, 2023

I've written a compatible action that has some extra tests and cleanups along with GitHub Enterprise support. The paths might work better since it uses path.join everywhere. https://github.com/marketplace/actions/ssh-agent-deploy-key give it a whirl if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants