Repository navigation
Fix hashFiles description in dependency caching reference - #46889
amkkoussay wants to merge 1 commit into
Conversation
How to review these changes 👓Thank you for your contribution. To review these changes, choose one of the following options: A Hubber will need to deploy your changes internally to review. Table of review linksNote: Please update the URL for your staging server or codespace. The table shows the files in the
Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server 🤖 This comment is automatically generated. |
There was a problem hiding this comment.
🟡 Changes recommended
The caching documentation makes an unconditional 64-character hash claim despite hashFiles returning an empty string when no files match and does not explain the shortened hash reused in later restore-key examples.
1 open issue
What changed in this PR
This pull request corrects the hashFiles description and cache-key example in the dependency-caching reference.
Changes:
- Replaces the incorrect
hashexpression withhashFiles('package-lock.json'). - Documents the full 64-character SHA-256 hash returned for matching files.
- Clarifies that the example uses a shortened hash.
| File | Description |
|---|---|
content/actions/reference/workflows-and-actions/dependency-caching.md |
Corrects the hashFiles explanation and cache-key example. |
Review effort: Lite
| {% endraw %} | ||
|
|
||
| {% data variables.product.prodname_dotcom %} evaluates the expression `hash "package-lock.json"` to derive the final `key`. | ||
| {% data variables.product.prodname_dotcom %} evaluates the `hashFiles('package-lock.json')` expression to derive the final `key`. `hashFiles` returns a full SHA-256 hash, so in practice the `key` ends with the complete 64-character hash. The example below shows a shortened version of the hash. |
|
Please don't raise pull requests against an existing issue that another user has raised until it's been marked with a |

Why:
Closes: #46499
What's being changed (if available, include any code snippets, screenshots, or gifs):
One paragraph in dependency-caching.md. The article said GitHub "evaluates the expression
hash "package-lock.json"" and showed the final key asnpm-d5ea0750. There is nohashfunction, and per the expressions reference in this repo,hashFilesreturns a full SHA-256 hash. The sentence now names the actualhashFiles('package-lock.json')expression, states that the key ends with the complete 64-character hash, and notes the example below shows a shortened version. The same shortened hash is reused later in the restore-keys examples — happy to add the same clarification there if you prefer.Check off the following: