No description
Find a file
2024-03-15 07:10:33 +01:00
action.yml Use the exitcode of the scp command as the one for the action 2024-03-15 06:55:45 +01:00
LICENSE Add readme and LICENSE 2024-03-15 07:10:33 +01:00
readme.md Add readme and LICENSE 2024-03-15 07:10:33 +01:00

scp-upload

This action provides a simple action that utilizes an installed scp client to perform an upload 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-upload@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: ./test.txt
    to: /some/path/onto/remote/

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.