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.14k stars 134 forks source link

Use password and key at same time #86

Closed zploited closed 1 year ago

zploited commented 1 year ago

Hi, To upload files/connect via ssh my provider requires both password AND private key to authenticate. If I set both in yml, then I get the error: can't set password and key at the same time

is there something I can do to get around this?

appleboy commented 1 year ago

@zploited I will take it.

appleboy commented 1 year ago

Some testing:

    - name: correct key but wrong password
      uses: appleboy/scp-action@7af00892de6f8397c5c3393cfb3b32ae7f91b94b
      with:
        host: ${{ secrets.HOST }}
        username: ${{ secrets.USERNAME }}
        key: ${{ secrets.KEY }}
        password: abcdefg
        port: ${{ secrets.PORT }}
        source: "tests/a.txt,tests/b.txt"
        target: "test"

    - name: correct password but wrong key
      uses: appleboy/scp-action@7af00892de6f8397c5c3393cfb3b32ae7f91b94b
      with:
        host: ${{ secrets.HOST }}
        username: ${{ secrets.USERNAME }}
        key: abcdefg
        password: ${{ secrets.PASSWORD }}
        port: ${{ secrets.PORT }}
        source: "tests/a.txt,tests/b.txt"
        target: "test"
appleboy commented 1 year ago

I will bump the next version to fix the issue or you can try appleboy/scp-action@7af00892de6f8397c5c3393cfb3b32ae7f91b94b