From c5eaa34e39ff28d222a5055e9a47dbd83176d137 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 25 Jun 2023 01:35:00 -0400 Subject: [PATCH] fix: use cache key based on run_id and run_attempt --- .github/workflows/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67c9486..b48276a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,8 +6,6 @@ on: jobs: build: runs-on: ubuntu-latest - outputs: - cache-primary-key: ${{ steps.cache.outputs.cache-primary-key }} steps: - uses: actions/checkout@v3 - name: Use Node.js @@ -23,7 +21,7 @@ jobs: with: # npm cache files are stored in `~/.npm` on Linux/macOS path: ./ - key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json','lib/**') }} + key: cache-${{ github.run_id }}-${{ github.run_attempt }} publish: runs-on: ubuntu-latest needs: build @@ -31,7 +29,7 @@ jobs: - uses: actions/cache/restore@v3 with: path: . - key: ${{ needs.build.outputs.cache-primary-key }} + key: cache-${{ github.run_id }}-${{ github.run_attempt }} - name: Install SSH key uses: shimataro/ssh-key-action@v2 with: