diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 85f79a1..4144d1c 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile index c16e69d..8f9bed3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ] \ No newline at end of file +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/README.md b/README.md index 3969e8e..80979ab 100644 --- a/README.md +++ b/README.md @@ -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 }} diff --git a/action.yml b/action.yml index 94edd78..8bad15f 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/entrypoint.sh b/entrypoint.sh index 88e362e..50155f1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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" \ No newline at end of file +time=$(date) +echo "-----------------------------" +echo "| Files successfully copied |" +echo "-----------------------------" +echo "::set-output name=time::$time" \ No newline at end of file