diff --git a/.github/actions/godot-cache-save/action.yml b/.github/actions/godot-cache-save/action.yml index f2d4455310..507a12d794 100644 --- a/.github/actions/godot-cache-save/action.yml +++ b/.github/actions/godot-cache-save/action.yml @@ -20,3 +20,14 @@ runs: with: path: ${{ inputs.scons-cache }} key: ${{ inputs.cache-name }}|${{ github.ref_name }}|${{ github.sha }} + + # This is done after saving the new cache so that the base cache remains more relevant, to reduce + # the risk of the cache being purged when multiple large PRs are pushed/merged at the same time. + - name: Ping default cache + uses: actions/cache/restore@v6 + if: github.ref_name != github.event.repository.default_branch + with: + path: ${{ inputs.scons-cache }} + key: ${{ inputs.cache-name }}|${{ github.event.repository.default_branch }}|${{ github.sha }} + restore-keys: ${{ inputs.cache-name }}|${{ github.event.repository.default_branch }} + lookup-only: true