No description
Find a file
2024-08-22 11:42:02 +02:00
action.yml Initial commit 2024-08-22 11:42:02 +02:00
LICENSE Initial commit 2024-08-22 11:42:02 +02:00
readme.md Initial commit 2024-08-22 11:42:02 +02:00

scp-download

This action provides a simple action that utilizes an installed scp client to perform an download of an file.

License

This project is licensed under AGPL-3.0-or-later; for further information see the LICENSE file inside the repository.

Usage

- uses: actions/scp-download@v1
  with:
    host: your.server.tld
    user: root
    port: '22'  # this is by default 22
    private_key: ${{ secrets.SSH_PRIVATE_KEY }}
    known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
    strict_hostkey_checking: 'true'
    from: /some/path/onto/remote/test.txt
    to: ./

The action is essentially just a wrapper around the scp binary, which needs to be on your $PATH prior to running this action. It stores both the private key and known hosts inside temporary files made with mktemp, which get removed after the step finishes.

The created command looks something like this:

$ scp -P $port -o IdentityFile=$tmp_privkey $from $user@$host:$to

If strict_hostkey_checking is set to true a -o StrictHostKeyChecking=yes is added, while a value of false result in a -o StrictHostKeyChecking=no being added to the flags before $from.

Additionally, if known_hosts is set a -o UserKnownHostsFile=$tmp_knownhosts is added.