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

Make this action work on Windows as well #15

Closed
Raynos opened this issue Jan 20, 2020 · 9 comments · Fixed by #17
Closed

Make this action work on Windows as well #15

Raynos opened this issue Jan 20, 2020 · 9 comments · Fixed by #17
Labels
question Further information is requested

Comments

@Raynos
Copy link

Raynos commented Jan 20, 2020

When using this github action on windows it's not happy as off two days ago.

I currently get the error

unable to start ssh-agent service, error :1058

I am currently trying to figure out what changed on windows 2019 on github actions ...

@Raynos
Copy link
Author

Raynos commented Jan 20, 2020

I spend a full day trying to figure this out.

The following works for me.

    # The webfactory/ssh-agent module does not work on Windows anymore
    # I do not recommend touching this SSH stuff, i spend two days
    # tweaking it just to get it to work on windows -.-
    - name: Configure SSH
      run: Set-Service ssh-agent -StartupType Manual
    - name: Start SSH
      run: Start-Service ssh-agent
    - name: Add SSH key
      run: echo $env:SSH_PRIVATE_KEY | ssh-add -
      env:
        SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
    - name: Add github.com to known_hosts
      run: |
        mkdir ~/.ssh
        ssh-keyscan github.com >> ~/.ssh/known_hosts
    - name: Use Node.js
      uses: actions/setup-node@v1
      with:
        node-version: 10.x
    - name: npm install
      run: |
        git config --global core.sshCommand "'C:\Windows\System32\OpenSSH\ssh.exe'"
        npm ci

The important parts are to start the other SSH agent ... and to configure git to use the other SSH agent ...

Obvouisly node & npm are unrelated to ssh-agent but I only use ssh-agent for npm when it tries to git clone private github repositories.

@Raynos
Copy link
Author

Raynos commented Jan 20, 2020

actions/runner-images@8185a8b

Yeah this makes sense to me now why it's broken.

@mpdude
Copy link
Member

mpdude commented Jan 20, 2020

As per the README, Windows isn’t even supported by this action.

But if it is possible to get it to work, open a PR!

@Raynos
Copy link
Author

Raynos commented Jan 21, 2020

Windows actually worked just fine out of the box a week ago.

@mpdude
Copy link
Member

mpdude commented Jan 21, 2020

Can it be that the ssh-agent has automatically been running in the background?

@Raynos
Copy link
Author

Raynos commented Jan 21, 2020

I searched about this issue. There’s lots of discussions about a breaking changes in some windows 10 update from mid 2018

It sounds like there was a change in the ssh behavior between windows and git.

@mpdude
Copy link
Member

mpdude commented Jan 29, 2020

@Raynos can you keep us updated here with instructions what is the "right" way to start and/or stop the ssh-agent on Windows?

Maybe we then can find someone to implement Windows support as well.

@mpdude mpdude added the question Further information is requested label Jan 29, 2020
@mpdude mpdude changed the title Windows support fails unable to start ssh-agent Make this action work on Windows as well Jan 29, 2020
@Raynos
Copy link
Author

Raynos commented Jan 30, 2020

The steps I’ve listed above work for me on windows.

@mpdude
Copy link
Member

mpdude commented Feb 4, 2020

If anybody can help getting this to run, join #17.

cardoe added a commit to cardoe/ssh-agent that referenced this issue Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants