diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9887990d7..a22eed86b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,9 +24,10 @@ jobs: with: go-version: 1.19.4 - - name: Cache Go modules + - name: Restore cache id: cache-go-modules - uses: actions/cache@v3 + if: github.event_name == 'pull_request' + uses: actions/cache/restore@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-${{ github.ref_name }}-go-modules-${{ hashFiles('**/go.sum') }} @@ -61,9 +62,10 @@ jobs: with: go-version: 1.19.4 - - name: Cache Go modules + - name: Restore cache id: cache-go-modules - uses: actions/cache@v3 + if: github.event_name == 'pull_request' + uses: actions/cache/restore@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-${{ github.ref_name }}-go-modules-${{ hashFiles('**/go.sum') }} @@ -294,7 +296,7 @@ jobs: with: go-version: 1.19.4 - - name: Cache Go + - name: Restore cache uses: actions/cache/restore@v3 with: path: |