From fc430f01941b89094f81f26c34503e585a546384 Mon Sep 17 00:00:00 2001 From: Marco Dalla Santa Date: Tue, 22 Mar 2022 15:02:57 +0000 Subject: [PATCH 1/3] Changed from /bin/bash to /bin/sh which is busybox for alpine --- .github/workflows/main.yml | 2 +- Dockerfile | 3 +-- entrypoint.sh | 2 +- with_key.sh | 2 ++ with_pass.sh | 4 +++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4c7a02..e19c77c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Test on: push: branches: - - main + - feature-use_sh_instead_of_bash jobs: test-key: diff --git a/Dockerfile b/Dockerfile index bdc6f99..9a1cf23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,7 @@ FROM alpine:latest RUN apk update && \ apk add --no-cache ca-certificates \ openssh-client \ - sshpass \ - bash + sshpass COPY LICENSE README.md / COPY entrypoint.sh with_key.sh with_pass.sh / diff --git a/entrypoint.sh b/entrypoint.sh index c0a7dfb..08a4b24 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PASSWORD=${INPUT_PASSWORD}; KEY=${INPUT_KEY}; diff --git a/with_key.sh b/with_key.sh index c20364a..1fbdc8c 100644 --- a/with_key.sh +++ b/with_key.sh @@ -1,3 +1,5 @@ +#!/bin/sh + echo "🔑 Adding ssh key..." && eval $(ssh-agent -s) && ssh-add <(echo "${INPUT_KEY}") && diff --git a/with_pass.sh b/with_pass.sh index e11664b..72ad8ae 100644 --- a/with_pass.sh +++ b/with_pass.sh @@ -1,3 +1,5 @@ +#!/bin/sh + PRE_UPLOAD=${INPUT_PRE_UPLOAD} if [ ! -z "$PRE_UPLOAD" ]; then { @@ -14,7 +16,7 @@ fi sshpass -p ${PASSWORD} scp ${INPUT_SSH_OPTIONS} ${INPUT_SCP_OPTIONS} -P "${INPUT_PORT}" -r ${INPUT_LOCAL} ${INPUT_USER}@${INPUT_HOST}:"${INPUT_REMOTE}" && echo "🙌 Uploaded via scp" } || { - echo "😢 Something went wrong during upload" && exit 1  + echo "😢 Something went wrong during upload" && exit 1 } POST_UPLOAD=${INPUT_POST_UPLOAD} From ab06ee730f922b9a3b73dd1fad42a57229d0b9a8 Mon Sep 17 00:00:00 2001 From: Marco Dalla Santa Date: Tue, 22 Mar 2022 21:38:49 +0000 Subject: [PATCH 2/3] Fix #17 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e19c77c..b4c7a02 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Test on: push: branches: - - feature-use_sh_instead_of_bash + - main jobs: test-key: From 23d4c34561cf39c57a88c0eedac00980e56ab470 Mon Sep 17 00:00:00 2001 From: Marco Dalla Santa Date: Tue, 22 Mar 2022 21:44:25 +0000 Subject: [PATCH 3/3] updates README and CHANGELOG --- CHANGELOG.md | 5 +++++ README.md | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e564999..0977ed2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # [Unreleased] +## [v1.2.0] - 2021-03-22 + +# Added +- [Issue #17](https://github.com/marcodallasanta/ssh-scp-deploy/issues/15) - Using /bin/sh instead of /bin/bash. + ## [v1.1.0] - 2021-10-02 # Added diff --git a/README.md b/README.md index 369a6cb..466d709 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,14 @@ I use this action to deploy my personal projects to remote server, restarting th - uses: mdallasanta/ssh-scp-deploy@{version} with: local: './' # Local file path - REQUIRED false - DEFAULT ./ - remote: '~/' # Remote file path - REQUIRED false - DEFAULT ~/ - host: ${{secrets.HOST}} # Remote server address - REQUIRED true - port: ${{secrets.PORT}} # Remote server port - REQUIRED false - DEFAULT 22 + remote: '~/' # Remote file path - REQUIRED false - DEFAULT ~/ + host: ${{secrets.HOST}} # Remote server address - REQUIRED true + port: ${{secrets.PORT}} # Remote server port - REQUIRED false - DEFAULT 22 user: ${{secrets.USER}} # Remote server user - REQUIRED true - password: ${{secrets.PASSWORD}} # User password - REQUIRED at least one of "password" or "key" - key: ${{secrets.KEY}} # Remote server private key - REQUIRED at least one of "password" or "key" - pre_upload: echo "This will be executed before the upload!" # Command to run via ssh before scp upload - REQUIRED false - post_upload: echo "This will be executed after the upload!" # Command to run via ssh after scp upload - REQUIRED false + password: ${{secrets.PASSWORD}} # User password - REQUIRED at least one of "password" or "key" + key: ${{secrets.KEY}} # Remote server private key - REQUIRED at least one of "password" or "key" + pre_upload: echo "This will be executed before the upload!" # Command to run via ssh before scp upload - REQUIRED false + post_upload: echo "This will be executed after the upload!" # Command to run via ssh after scp upload - REQUIRED false ssh_options: -o StrictHostKeyChecking=no # A set of ssh_option separated by -o - REQUIRED false - DEFAULT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null scp_options: -v # Flags to use during scp - REQUIRED false - DEFAULT '' ``` @@ -62,6 +62,6 @@ Thanks to: ## 📝 License -Copyright © 2020-2021 [Marco Dalla Santa](https://github.com/marcodallasanta) +Copyright © 2020-2022 [Marco Dalla Santa](https://github.com/marcodallasanta) The source code, scripts and documentation in this project are released under the [MIT License](LICENSE) \ No newline at end of file