Skip to content

Correct hashFiles explanation and example cache key - #47078

Closed
aniruddhaadak80 wants to merge 1 commit into
github:mainfrom
aniruddhaadak80:fix/cache-key-hashfiles-wording
Closed

aniruddhaadak80 wants to merge 1 commit into
github:mainfrom
aniruddhaadak80:fix/cache-key-hashfiles-wording

Conversation

@aniruddhaadak80

Copy link
Copy Markdown
Contributor

Why:

Closes: #46499

What's being changed (if available, include any code snippets, screenshots, or gifs):

The dependency caching article described the cache key example as evaluating the expression hash "package-lock.json" and showed the abbreviated example key npm-d5ea0750. Neither is accurate: there is no hash expression, and hashFiles() returns a full SHA-256 hash. The paragraph now names hashFiles(), states that the key contains the full hash, and uses a placeholder (npm-<64-character SHA-256 hash>) instead of the misleading short value.

Verification

  • npm ci --prefer-offline --no-audit --no-fund in the isolated worktree: succeeded (added 1044 packages), with EBADENGINE warnings because this machine has Node v22.23.2 while the repository requires Node ^26.
  • npm run lint-content -- --paths content/actions/reference/workflows-and-actions/dependency-caching.md: failed under Node v22 with TypeError: RegExp.escape is not a function.
  • Re-ran the same linter with a locally fetched Node v26.13.1: npx -y node@26 ./node_modules/tsx/dist/cli.mjs src/content-linter/scripts/lint-content.ts --paths content/actions/reference/workflows-and-actions/dependency-caching.md → Markdownlint finished in 122.6 s / No errors found.
  • Checked the wording of hashFiles() against content/actions/reference/workflows-and-actions/expressions.md, which documents a final SHA-256 hash.

Limitations

  • The full site build and GitHub Actions CI were not run locally.
  • git push to the fork failed with HTTP 408 because the fork's main is 1161 commits behind upstream/main, so the branch and its single-file commit were created directly on the fork with the GitHub REST API. The content is identical to the local commit.
  • No subject matter expert review has taken place; wording should be confirmed by a GitHub maintainer.

AI assistance disclosure

This change and PR body were prepared with AI assistance. The issue, the existing hashFiles() documentation, and local validation results were checked before submission.

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

Copilot AI lite review requested due to automatic review settings November 26, 2026 15:29
@github-actions

Copy link
Copy Markdown
Contributor

Warning

This pull request was closed automatically.

Please don't raise pull requests against an existing issue that another user has raised until it's been marked with a help wanted label. We need to properly assess all issues before we can accept community contributions, and determine whether it's something we need to fix internally, or how many articles are affected and what the scope of the fix will be. For now, we're going to close this pull request.

@github-actions github-actions Bot closed this Nov 26, 2026
@github-actions github-actions Bot added the triage Do not begin working on this issue until triaged by the team label Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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 links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
actions/reference/workflows-and-actions/dependency-caching.md fpt
ghec
ghes@ 3.23 3.22 3.21 3.20 3.19
fpt
ghec
ghes@ 3.23 3.22 3.21 3.20 3.19

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation correction remains incomplete because related examples still present abbreviated hashes as resolved values, leaving the article internally inconsistent.

1 open issue
What changed in this PR

This PR corrects the dependency-caching documentation so that hashFiles() is accurately described and the example cache key uses a full SHA-256 hash.

Changes:

  • Replaces the incorrect reference to a nonexistent hash expression.
  • Clarifies that the cache key contains a full SHA-256 hash.
  • Replaces the abbreviated example with a 64-character hash placeholder.
File Description
content/​actions/​reference/​workflows-and-actions/​dependency-caching.md Updates the hashFiles() explanation and example cache key.

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 expression to derive the final `key`. The `hashFiles()` function returns a SHA-256 hash of the file's contents, so the resulting key contains the full hash. For example:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Do not begin working on this issue until triaged by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing content: evaluates the expression hash "package-lock.json" to derive the final key npm-d5ea0750

2 participants