appleboy / scp-action

GitHub Action that copy files and artifacts via SSH.
https://github.com/marketplace/actions/scp-command-to-transfer-files
MIT License
1.22k stars 136 forks source link

tar: empty archive when scp a dir to a windows server path with chinese charactor on gitea act_runner with bookworm docker #131

Open YujiaCheng1996 opened 1 year ago

YujiaCheng1996 commented 1 year ago

my action:

    - run: pwd

    - run: mkdir dist

    - run: cp index.html dist

    - run: ls -al ./dist

    - name: Get dist directory
      shell: bash
      id: get-dist-dir
      run: |
        echo "$(pwd)/dist"
        echo "DIST_DIR=$(pwd)/dist" >> $GITHUB_OUTPUT

    - name: Upload dist
      uses: appleboy/scp-action@v0.1.4
      with:
        host: '192.168.10.xxx'
        username: 'administrator'
        port: '22'
        key: '${{ secrets.SSHKEY }}'
        debug: true
        rm: true
        source: '${{ steps.get-dist-dir.outputs.DIST_DIR }}'
        target: E:\中文路径\

result: image The runner is gitea act_runner (docker) and ran in node:latest-bookworm. The remote is a windows server 2008 with Win32-OpenSSH. This shell command works fine in local windows11 builtin powershell terminal. scp -r dist theremoteserveralias:E:\中文路径\ Your ssh-action dosen't work on the same server as well. However,the windows server only accepts cmd command and there is no 'tar' present.

I already tried source: 'dist' and source: './dist', didn't work. So I make sure it gets a non-empty full path.