From 05ed7227f8163476921902cd6c451e261724a26b Mon Sep 17 00:00:00 2001 From: Kostis Papazafeiropoulos Date: Mon, 27 Apr 2026 17:49:08 +0000 Subject: [PATCH 1/3] Bump actions/cache from v4 to v5 Signed-off-by: Kostis Papazafeiropoulos --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index aa98739..4b6ace2 100644 --- a/action.yml +++ b/action.yml @@ -50,7 +50,7 @@ runs: - name: Cache mc binary id: cache-mc if: ${{ steps.check-mc.outputs.exists == 'false' }} - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: /usr/local/bin/mc key: mc-${{ steps.mc-sha.outputs.sha256 }} From e565c56bf9ac8b510b21d666a983b49806f9004e Mon Sep 17 00:00:00 2001 From: Kostis Papazafeiropoulos Date: Mon, 27 Apr 2026 18:28:07 +0000 Subject: [PATCH 2/3] Improve code style Signed-off-by: Kostis Papazafeiropoulos --- action.yml | 53 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/action.yml b/action.yml index 4b6ace2..42916cf 100644 --- a/action.yml +++ b/action.yml @@ -38,28 +38,28 @@ runs: - name: Download latest mc SHA256 id: mc-sha - if: ${{ steps.check-mc.outputs.exists == 'false' }} + if: steps.check-mc.outputs.exists == 'false' run: | arch=$(dpkg --print-architecture | sed 's/armhf/arm/g') sha=$(wget -qO- \ - https://dl.min.io/client/mc/release/linux-"${arch}"/mc.sha256sum \ + "https://dl.min.io/client/mc/release/linux-${arch}/mc.sha256sum" \ | awk '{print $1}') echo "sha256=$sha" >> "$GITHUB_OUTPUT" shell: bash - name: Cache mc binary id: cache-mc - if: ${{ steps.check-mc.outputs.exists == 'false' }} + if: steps.check-mc.outputs.exists == 'false' uses: actions/cache@v5 with: path: /usr/local/bin/mc - key: mc-${{ steps.mc-sha.outputs.sha256 }} + key: "mc-${{ steps.mc-sha.outputs.sha256 }}" - name: Setup mc working-directory: /usr/local/bin if: >- - ${{ steps.check-mc.outputs.exists == 'false' - && steps.cache-mc.outputs.cache-hit != 'true' }} + steps.check-mc.outputs.exists == 'false' && + steps.cache-mc.outputs.cache-hit != 'true' run: | arch=$(dpkg --print-architecture | sed 's/armhf/arm/g') sudo wget --progres=dot:binary \ @@ -68,38 +68,45 @@ runs: shell: bash - name: Setup s3 alias - run: | - mc alias set s3 "${{ inputs.url }}" \ - "${{ inputs.access-key }}" "${{ inputs.secret-key }}" + env: + URL: ${{ inputs.url }} + ACCESS_KEY: ${{ inputs.access-key }} + SECRET_KEY: ${{ inputs.secret-key }} + run: mc alias set s3 "$URL" "$ACCESS_KEY" "$SECRET_KEY" shell: bash - name: Upload objects + env: + LOCAL_PATH: ${{ inputs.local-path }} + REMOTE_PATH: ${{ inputs.remote-path }} run: | - echo "Will upload ${{ inputs.local-path }} to ${{ inputs.remote-path }}" - local_path=${{ inputs.local-path }} - if [ "${local_path#*'*'}" != "$local_path" ]; then + echo "Will upload ${LOCAL_PATH} to ${REMOTE_PATH}" + if [[ "${LOCAL_PATH#*'*'}" != "$LOCAL_PATH" ]]; then # Handle local_files with wildcards - local_dir=$(dirname "$local_path") - local_files=$(basename "$local_path") + local_dir=$(dirname "$LOCAL_PATH") + local_files=$(basename "$LOCAL_PATH") IFS=$'\n' - for p in $(find "$local_dir" -maxdepth 1 -name "$local_files" | \ + for p in $(find "$local_dir" -maxdepth 1 -name "$local_files" | sort -u); do - [ "$p" = "$local_dir" ] && continue - mc cp -r "$p" "s3/${{ inputs.remote-path }}" + [[ "$p" != "$local_dir" ]] || continue + mc cp -r "$p" "s3/${REMOTE_PATH}" done unset IFS else - mc cp -r "$local_path" "s3/${{ inputs.remote-path }}" + mc cp -r "$LOCAL_PATH" "s3/${REMOTE_PATH}" fi shell: bash - name: Set policy + env: + POLICY: ${{ inputs.policy }} + REMOTE_PATH: ${{ inputs.remote-path }} run: | - if [ "${{ inputs.policy }}" = 1 ] ; then - echo "Will make ${{ inputs.remote-path }} public" - mc anonymous -r set download "s3/${{ inputs.remote-path }}" + if [[ "$POLICY" == 1 ]]; then + echo "Will make ${REMOTE_PATH} public" + mc anonymous -r set download "s3/${REMOTE_PATH}" else - echo "Will make ${{ inputs.remote-path }} private" - mc anonymous -r set private "s3/${{ inputs.remote-path }}" || true + echo "Will make ${REMOTE_PATH} private" + mc anonymous -r set private "s3/${REMOTE_PATH}" || true fi shell: bash From 60dff1d4d7d3f2fff39f788bfea1e081b4a05268 Mon Sep 17 00:00:00 2001 From: Kostis Papazafeiropoulos Date: Mon, 27 Apr 2026 21:54:50 +0000 Subject: [PATCH 3/3] ci: Use GitHub runners Signed-off-by: Kostis Papazafeiropoulos --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a8dc45..2e71452 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: push jobs: upload: - runs-on: self-hosted + runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v4