I am setting cache to `false` and directly use actions/cache:
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
if: ${{ inputs.setup-go == 'true' }}
with:
path: |
${{ env.gocache }}
${{ env.gomodcache }}
key: ${{ runner.os }}-${{ runner.arch }}-go${{ steps.go-setup.outputs.go-version }}-${{ hashFiles('go.sum') }}-${{ env.today }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-go${{ steps.go-setup.outputs.go-version }}-${{ hashFiles('go.sum') }}-
${{ runner.os }}-${{ runner.arch }}-go${{ steps.go-setup.outputs.go-version }}-
You get one new cache every day, and you can still load the most recent one if you are the first run today.