Skip to content

docs: Update restore-only cache documentation#1550

Open
priya-kinthali wants to merge 2 commits into
actions:mainfrom
priya-kinthali:doc-update-restore-example
Open

docs: Update restore-only cache documentation#1550
priya-kinthali wants to merge 2 commits into
actions:mainfrom
priya-kinthali:doc-update-restore-example

Conversation

@priya-kinthali
Copy link
Copy Markdown
Contributor

Description:
This PR updates the restore-only cache example in docs/advanced-usage.md with a more detailed workflow using actions/cache/restore@v5.

Related issue:
#1545

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

Copilot AI review requested due to automatic review settings May 14, 2026 11:02
@priya-kinthali priya-kinthali requested a review from a team as a code owner May 14, 2026 11:02
@priya-kinthali priya-kinthali self-assigned this May 14, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the "Restore-Only Cache" example in docs/advanced-usage.md to address issue #1545, where the documented cache key did not match the actual key produced by setup-node (node-cache-${platform}-${arch}-${packageManager}-${fileHash}). The new example uses actions/cache/restore@v5 and computes a key matching the action's internal format.

Changes:

  • Replaced the previous restore-only example with a snippet that builds the cache key as node-cache-${{ runner.os }}-${{ env.ARCH }}-npm-${{ hashFiles('**/package-lock.json') }}, including commented-out yarn/pnpm variants.
  • Added an ARCH env var derived from a lower-cased runner.arch, and a step to read the package manager's cache path dynamically.
  • Updated the trailing reference link to point to actions/cache/restore.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/advanced-usage.md
Comment thread docs/advanced-usage.md
Comment thread docs/advanced-usage.md Outdated
Comment thread docs/advanced-usage.md
Comment thread docs/advanced-usage.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants