chore(deps): bump tj-actions/changed-files from 43 to 44 (#171)
Bumps tj-actions/changed-files from 43 to 44.
updated-dependencies:
- dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-major …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
🚀 SCP for GitHub Actions
GitHub Action for copying files and artifacts via SSH.
Important: Only support Linux docker container.
Usage
Copy files and artifacts via SSH:
Input variables
See the action.yml file for more detail information.
22
30s
10m
false
--overwrite
flag with tar, overwrite existing files when extractingtar
--dereference
flag with tar, follow symlinks; archive and dump the files they point toSSH Proxy Setting:
22
30s
Setting up a SSH Key
Make sure to follow the below steps while creating SSH Keys and using them. The best practice is create the SSH Keys on local machine not remote machine. Login with username specified in Github Secrets. Generate a RSA Key-Pair:
Add newly generated key into Authorized keys. Read more about authorized keys here.
Copy Private Key content and paste in Github Secrets.
See the detail information about SSH login without password.
A note from one of our readers: Depending on your version of SSH you might also have to do the following changes:
.ssh/authorized_keys2
.ssh
to 700.ssh/authorized_keys2
to 640If you are using OpenSSH
If you are currently using OpenSSH and are getting the following error:
Make sure that your key algorithm of choice is supported. On Ubuntu 20.04 or later you must explicitly allow the use of the ssh-rsa algorithm. Add the following line to your OpenSSH daemon file (which is either
/etc/ssh/sshd_config
or a drop-in file under/etc/ssh/sshd_config.d/
):Alternatively,
ed25519
keys are accepted by default in OpenSSH. You could use this instead of rsa if needed:Example
Copy file via a SSH password:
Copy file via a SSH key:
Example configuration for ignore list:
Example configuration for multiple servers:
Example configuration for exclude custom files:
Upload artifact files to remote server:
Remove the specified number of leading path elements:
Old target structure:
New target structure:
Only copy files that are newer than the corresponding destination files:
Protecting a Private Key. The purpose of the passphrase is usually to encrypt the private key. This makes the key file by itself useless to an attacker. It is not uncommon for files to leak from backups or decommissioned hardware, and hackers commonly exfiltrate files from compromised systems.
When copying files from a Linux runner to a Windows server, you should:
tar_dereference
andrm
variable totrue
in the YAML fileport
value through a variable/c/path/to/target/
Change the default OpenSSH shell to git bach with the following powershell command.
Convert the target path to a Unix path:
/c/path/to/target/