From 89cd475e758073816d9b0dc73be73406d2ec3e96 Mon Sep 17 00:00:00 2001 From: Luxoruus <64335628+Luxoruus@users.noreply.github.com> Date: Thu, 20 Jul 2023 20:52:55 +0100 Subject: [PATCH] Update README.md More instructions to how to setup scp-action for Windows servers --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index c1d1879..0ed788c 100644 --- a/README.md +++ b/README.md @@ -310,3 +310,27 @@ Protecting a Private Key. The purpose of the passphrase is usually to encrypt th source: "tests/a.txt,tests/b.txt" target: your_server_target_folder_path ``` +When copying files from a Linux runner to a Windows server, you should: + +1. Download git for Windows +2. Change the default OpenSSH shell to git bach with the following powershell command: +```powershell +New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "$env:Programfiles\Git\bin\bash.exe" -PropertyType String -Force +``` +3. Set `tar_dereference` and `rm` variable to `true` in the YAML file +4. Avoid putting the `port` value through a variable +5. Convert the target path to a bash path: +```diff + - name: Copy to Windows + uses: appleboy/scp-action@v0.1.4 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + port: 22 + source: 'your_source_path' +- target: 'C:\path\to\target' ++ target: 'C:/path/to/target' ++ tar_dereference: true ++ rm: true +```