mirror of
https://github.com/Hermanverschooten/ssh-copy-command-action.git
synced 2026-09-10 05:35:39 +00:00
Copy a file over SSH and execute a command afterwards.
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Composite actions run shell steps with `set -e`, causing the script to exit immediately when scp returns non-zero. The `if [ $? -eq 0 ]` guard around the remote command was unreachable in that case. Remove broken dead-code conditionals for SCP_ARGS/CMD_ARGS defaults (input defaults already handle this) and the unreachable $? check. |
||
| .github/workflows | ||
| .gitignore | ||
| action.yml | ||
| LICENSE | ||
| README.md | ||
ssh-copy-command-action
Copy a file over SSH and execute a command afterwards.
- name: Deploy
uses: Hermanverschooten/ssh-copy-command-action@v1
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
SOURCE: "./source.tar.gz"
REMOTE_HOST: my_host.example.org
REMOTE_USER: root
TARGET: "/opt/dest"
CMD: "./deploy"
This action uses scp to copy the file to the remote destination, then reuses that master control socket to run the given command over ssh.