Fail the workflow on a cache miss
mainTo restrict a workflow so that it only runs when a cache is successfully found, set fail-on-cache-miss: true. To ensure it only succeeds on an exact match for the primary key (and not a partial match), leave restore-keys empty.
steps:
- uses: actions/checkout@v6
- uses: actions/cache/restore@v5
id: cache
with:
path: path/to/dependencies
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
fail-on-cache-miss: true
- name: Build
run: /build.sh