Returns the time

This commit is contained in:
srueda99 2022-04-18 13:34:19 -05:00
parent b29b4d4bf6
commit dfd2bccf3c
5 changed files with 15 additions and 11 deletions

View File

@ -10,7 +10,7 @@ jobs:
- name: Copy using key
id: key-job
uses: srueda99/scp-action@v2
uses: srueda99/scp-action@v3
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}

View File

@ -1,8 +1,8 @@
# Runs on Alpine container, latest version.
FROM alpine
# Copy the script to the home directory of the container.
COPY entrypoint.sh /home/entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
# Grant executable permission on the script.
RUN ["chmod", "+x", "/home/entrypoint.sh"]
RUN ["chmod", "+x", "/entrypoint.sh"]
# Runs the script.
ENTRYPOINT [ "/home/entrypoint.sh" ]
ENTRYPOINT [ "/entrypoint.sh" ]

View File

@ -23,7 +23,7 @@ Use Github secrets to give these parameters.
**With password**
```
name: Copy using password
uses: srueda99/scp-action@v2
uses: srueda99/scp-action@v3
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}
@ -35,7 +35,7 @@ with:
**With key**
```
name: Copy using key
uses: srueda99/scp-action@v2
uses: srueda99/scp-action@v3
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}
@ -47,11 +47,11 @@ with:
**With origin folder**
```
name: Copy using password
uses: srueda99/scp-action@v2
uses: srueda99/scp-action@v3
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}
origin: "/home/*"
origin: "./*"
destination: "/home/${{ secrets.SERVER_USERNAME }}/"
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
@ -60,7 +60,7 @@ with:
**With passphrase**
```
name: Copy using key
uses: srueda99/scp-action@v2
uses: srueda99/scp-action@v3
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}

View File

@ -30,7 +30,7 @@ inputs:
description: 'Passphrase for SSH key'
outputs:
time:
description: 'Returns the result'
description: 'Returns the time when the script ran'
runs:
using: 'docker'
image: 'Dockerfile'

View File

@ -14,4 +14,8 @@ else
# Runs the SCP command
sshpass -p $INPUT_PASSWORD scp -P $INPUT_PORT -o StrictHostKeyChecking=no $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"
fi
echo "Files successfully copied"
time=$(date)
echo "-----------------------------"
echo "| Files successfully copied |"
echo "-----------------------------"
echo "::set-output name=time::$time"