From 3ef78dd6418eca380cbfb919939581f3fca874cd Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Sat, 13 Aug 2022 16:40:40 +0300 Subject: [PATCH 1/2] Set best practice bash options in shell script --- entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index f662dd7..5d7a55b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -euxo pipefail + mc alias set deploy $MINIO_ENDPOINT $MINIO_ACCESS_KEY $MINIO_SECRET_KEY mc mirror --overwrite $1 "deploy/$2" From d8b3a5dadb1428cd04f37cae267c2bb531c76cf8 Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Sat, 13 Aug 2022 16:41:02 +0300 Subject: [PATCH 2/2] Add an optional insecure option for minio --- action.yml | 5 +++++ entrypoint.sh | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index dfbba1a..3a285e6 100644 --- a/action.yml +++ b/action.yml @@ -22,6 +22,10 @@ inputs: description: 'Set a target directory for deployment (with a leading slash).' required: false default: '/' + insecure: + description: 'Trust SSL certificates with minio --insecure option' + required: false + default: 'false' runs: using: 'docker' image: 'Dockerfile' @@ -29,6 +33,7 @@ runs: MINIO_ENDPOINT: ${{ inputs.endpoint }} MINIO_ACCESS_KEY: ${{ inputs.access_key }} MINIO_SECRET_KEY: ${{ inputs.secret_key }} + MINIO_INSECURE: ${{ inputs.insecure }} args: - ${{ inputs.source_dir }} - '${{ inputs.bucket }}${{ inputs.target_dir }}' diff --git a/entrypoint.sh b/entrypoint.sh index 5d7a55b..608db87 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,4 +4,9 @@ set -euxo pipefail mc alias set deploy $MINIO_ENDPOINT $MINIO_ACCESS_KEY $MINIO_SECRET_KEY -mc mirror --overwrite $1 "deploy/$2" +insecure_option="" +if ["$MINIO_INSECURE" == "true"]; then + insecure_option="--insecure" +fi + +mc mirror --overwrite $insecure_option $1 "deploy/$2"