Changes on entrypoint

This commit is contained in:
srueda99 2022-04-18 13:48:13 -05:00
parent 238d686c30
commit b2b980a96f
3 changed files with 9 additions and 8 deletions

View File

@ -10,10 +10,11 @@ jobs:
- name: Copy using key
id: key-job
uses: srueda99/scp-action@latest
uses: srueda99/scp-action@v4
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}
origin: "./*"
destination: "/home/${{ secrets.SERVER_USERNAME }}/"
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}

View File

@ -12,7 +12,7 @@ You must give:
- The `password` for the user or the private `key` in case the connection is based on SSH keys.
Optional:
- The `origin` folder is set by default as _"./*"_ but you can also specify it.
- The `origin` folder is set by default as __"./*"__ but you can also specify it.
- The `port` is set as **22** by default, you can also specify another one.
- The `passphrase` if necessary.
@ -25,7 +25,7 @@ Use Github secrets to give these parameters.
**With password**
```
name: copy using password
uses: srueda99/scp-action@v3
uses: srueda99/scp-action@v4
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}
@ -37,7 +37,7 @@ with:
**With key**
```
name: copy using key
uses: srueda99/scp-action@v3
uses: srueda99/scp-action@v4
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}
@ -49,7 +49,7 @@ with:
**With origin folder**
```
name: copy using password
uses: srueda99/scp-action@v3
uses: srueda99/scp-action@v4
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}
@ -62,7 +62,7 @@ with:
**With passphrase**
```
name: copy using key
uses: srueda99/scp-action@v3
uses: srueda99/scp-action@v4
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}

View File

@ -2,14 +2,14 @@
# Checking if the key input is not empty
if [[ "$INPUT_KEY" ]]; then
# If it is not emty, it uses the key for the SCP
# If it is not empty, it uses the key for the SCP
echo -e "${INPUT_KEY}" > key # Creates a file with the key content
chmod 400 key # Set the key as Read-Only
echo "Trying SCP process with SSH key"
# Runs the SCP command
scp -P $INPUT_PORT -o StrictHostKeyChecking=no -i key $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"
else
# If the keyis emty, it uses the password for the SCP
# If the keyis empty, it uses the password for the SCP
echo "Trying SCP process with password"
# Runs the SCP command
sshpass -p $INPUT_PASSWORD scp -P $INPUT_PORT -o StrictHostKeyChecking=no $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"