From 0a3efd7aa173899ce5e9be0a26cd69003d4835f8 Mon Sep 17 00:00:00 2001 From: Marco Carrozzo Date: Thu, 19 Jan 2023 19:18:46 +0100 Subject: [PATCH] new hash function --- .github/actions/download-cache-and-artifacts/action.yml | 7 +++---- .github/actions/upload-cache-and-artifacts/action.yml | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/actions/download-cache-and-artifacts/action.yml b/.github/actions/download-cache-and-artifacts/action.yml index 2945099bcd..4061466d35 100644 --- a/.github/actions/download-cache-and-artifacts/action.yml +++ b/.github/actions/download-cache-and-artifacts/action.yml @@ -23,7 +23,7 @@ runs: - name: download and extract artifacts from s3 shell: bash env: - REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}" + REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}" run: | packages=( $(echo ${{ inputs.packages }}) ) for i in "${packages[@]}"; do @@ -33,10 +33,9 @@ runs: done - name: download and extract persistent artifacts from s3 shell: bash - env: - REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ hashFiles('**/package-lock.json') }}" run: | - echo using hashfile '${{ hashFiles("**/package-lock.json") }}' + HASH=$(md5sum package-lock.json | cut -f 1 -d " ") + REMOTE_PATH="alfresco-ng2-components/build-cache/${HASH}" echo remote path $REMOTE_PATH if [ -n "${{ inputs.cache-key-suffix }}" ]; then REMOTE_PATH="${REMOTE_PATH}-${{ inputs.cache-key-suffix }}" diff --git a/.github/actions/upload-cache-and-artifacts/action.yml b/.github/actions/upload-cache-and-artifacts/action.yml index 0b057bfbf6..62f4d0eb1b 100644 --- a/.github/actions/upload-cache-and-artifacts/action.yml +++ b/.github/actions/upload-cache-and-artifacts/action.yml @@ -32,9 +32,9 @@ runs: done - name: tar and upload persistent artifacts shell: bash - env: - REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ hashFiles('**/package-lock.json') }}" run: | + HASH=$(md5sum package-lock.json | cut -f 1 -d " ") + REMOTE_PATH="alfresco-ng2-components/build-cache/${HASH}" if [ -n "${{ inputs.cache-key-suffix }}" ]; then REMOTE_PATH="${REMOTE_PATH}-${{ inputs.cache-key-suffix }}" fi