-
Notifications
You must be signed in to change notification settings - Fork 256
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
Try running on Windows #17
Conversation
Check the environment: See lukesampson/pshazz#70 (comment) for the startup errors. |
This currently fails with:
|
It sounds like the error you get is that git is using the builtin ssh and not the windows one that you started. |
To me it looks as if it fails on |
I just got this process working on Windows, similar to how others have, but one thing that hasn't been pointed out: After enabling the service (start=demand), the service needs to be started through Windows, not by running ssh-agent. This is done by running Note that this does not explicitly use a socket file, but it appears that the Windows installation of OpenSSH already knows how to find the ssh-agent if the service is running (ie. |
I don't know how to translate this into a github-action but the following powershell script got the ssh-agent running on the windows-2016 image . In my case the goal was to allow deploy-key access to a github repo. ` - name: setup ssh key for rules_support deploy
|
@leafac I saw your comment over at vercel/pkg#837. If you have a real Windows use case for this action, could you give this branch a try? |
3b42494
to
f6308c4
Compare
The docker demo fails because the ubuntu docker image has not ssh installed. So either use a docker image with openssh-client installed or install it in the action with
|
❤️ |
@mpdude Just tried windows-2016 again. - all that is needed is to add a choco install of the SSHAgentFeature prior to the webfactory/ssh-agent@try-windows then it works. Personally I'm happy to do this given the deprecated state of windows-2016. It might be worth documenting it though. |
Would the |
You'll get an "The specified service already exists" error if you try to over install with chocolatey. That makes it rather awkward to use as a no-op, not a cheap one in any case because you would have to build filtering around it. |
Ok, let’s ignore Windows 2016 then. |
This doesn't work for me on Windows either. It gives me a permission denied error at the last step on windows but not on Ubuntu. I am using a deploy key on the private company repo. Let me know if it's worth making a new issue for this name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the dev branch
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-latest # The app is intended primarily for Windows
# runs-on: ubuntu-latest # Debug; this cannot build windows builds!!!
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# We depend on another private repo of ours so we need to set up SSH agent with a key
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Debug
run: git clone [email protected]:*********.git |
Can you share the Action output/log? |
Yes sir, I actually made a fresh public repo with this workflow and the same one but on Ubuntu, I also made a private repo with a deploy key. I add the key as a secret. You can see the workflow logs for yourself. Here is the Ubuntu one and here is the Windows version. Feel free to mess around with the workflow files and re-run them |
Could you make the Windows action run And do you know how to enable SSH verbosity for the I don't think I could edit the workflows and/or make them run, could I? |
I'm experimenting the same issue and since it's also a private repo I can't share much 😅 |
Basically the SSH Agent steps worked and said "Keys added". 👍 but at the next step cargo (Rust) fails to use the key to clone a private dependency. |
Ok, understand. Please at first make sure the agent started in the first step is still alive/running when the next step starts, and that keys are still loaded. Does |
For debugging Git's usage of SSH on Windows: |
Ok I will try all of that but it will probably be on Monday if you don't mind. |
I tried with a matrix build in this repo, and yes, it fails – but only when using with deployment keys. https://github.com/webfactory/ssh-agent/runs/1990796091?check_suite_focus=true Unfortunately, I am not familiar with Windows and do not have a direct Windows machine myself, so probably I'd need a little help. Here's my guess what happens: After the keys have been loaded, they are listed with Then, when connecting, this file is used as the Under Linux, this file can contain the public key part (from the Could somebody please try if the SSH Agent on Windows works the same way? Can a private key be loaded from the agent by providing the public key part through the |
It appears that the answer is negative:
N.B.: I have 2 days of experience with Windows, so the test above may not make sense. I’m used to macOS/Linux, but was tired of having my stuff breaking on Windows and having to use VirtualBox to figure it out, so last weekend I bought a PC for this kind of investigation. |
👍 |
I am seeing errors when trying to load multiple private keys on windows-2019. Please see these issues. #130 and actions/checkout#928 |
Totally forgot to answer here sorry! And I don't remember exactly what issue I had... It seems what you did fixed it for me |
Hm, it doesn't seem to work for me, running on build:
strategy:
matrix:
include:
- os: macos-latest
- os: ubuntu-latest
- os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- run: cargo build --release
# ... It invokes Rust's cargo build tool to build a binary from the current repo.
Note: By default, cargo uses the git library that it's linked to, to download repos. But when setting Btw, the output of the
Any idea why |
Banca móvil |
For me v0.8.0 fails on our private github runner on the Windows build. It works correctly on our Linux build (under wsl). The issue is that for some reason in our Windows build it is not able to clone the linked private repo because "Host key verification failed". I've tried multiple things suggested, including updating OpenSSH on the Windows side to the latest beta release, but nothing helped. After switching to v0.7.0 both the Windows and the Linux builds now work as intended. So I don't know what changed between v0.7.0 and v0.8.0 but for me it regressed the Windows side of things to the point that it has become unusable. |
I also having the same issue as @PJKuyten. Downgrade to 0.7.0 fix the issue. |
Downgrading von 0.9.0 to 0.7.0 worked for me as well |
What is the status of this action for windows runners? I have no problem in linux-latest and macos-latest runners, but windows-latest show all kind of weird issues when trying to setup the ssh connection. I have tried some workarounds that seem to work one time, and then they fail and i'm unsure how to continue so i would greatly appreciante any help |
This improves home directory detection to make the action work for Windows and container-based workflows.
Windows-based workflows also need an additional command to start the
ssh-agent
.Resolves #15, resolves #20, resolves #55, resolves #58.