actions / actions/cache

Document how a restore-key cache is chosen

Open
#1,657 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.6k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

I don't see any documentation that describes which partial cache match will be chosen when there are multiple options.

Consider the following case:

Cache key pattern: {branch-name}-{content-hash}
My cache key: rob-branch--5555
My cache restore keys: rob-branch--
Available caches:

  • rob-branch--11111, created 1 day ago
  • rob-branch--3333, created 1 minute ago
  • rob-branch--4444, created 10 minutes ago

All of these match the restore pattern.

If the fallback match is based on the newest matching cache file, rob-branch--3333 will be restored.
If the fallback match is based on alphabetic sorting, rob-branch--1111 will be restored.
If the fallback match is based on reverse alphabetic sorting, rob-branch--4444 will be restored.

I need this information to deliver the best partial matches for incremental builds. Thanks for your help.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no documentation file or test. Start by locating the existing restore-key documentation and the cache matching implementation, then verify which matching cache is selected; the work is done when the selection rule and the supplied example are documented clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.