Fix cache re-evaluation key example in caching strategies docs

Based on the example provided, the save key here would always be different from the cache restore key. And on top of that, the function call for `hashFiles` looked incorrect on the save action (both in casing and for the files it was hashing).

This PR aligns the examples so they'd restore & save for the same purpose.
This commit is contained in:
Madison Swain-Bowden 2026-02-04 11:51:19 -08:00 committed by GitHub
parent b7e8d49f17
commit 830f24e4d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -238,7 +238,7 @@ Case 2: Where the user would want to re-evaluate the key
```yaml ```yaml
uses: actions/cache/save@v5 uses: actions/cache/save@v5
with: with:
key: npm-cache-${{hashfiles(package-lock.json)}} key: cache-${{ hashFiles('**/lockfiles') }}
``` ```
### Saving cache even if the build fails ### Saving cache even if the build fails