| action.yml | ||
| LICENSE | ||
| readme.md | ||
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.