`@actions/cache`, why are paths needed to compute version
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When using the cache action, the path is used to generate a unique version.
Unfortunately depending on the runner type official or self-hosted) the workspace do changes and creates a different version.
This leads to a mistmatch and a failure.
To Reproduce
Steps to reproduce the behavior:
- Have self-hosted AND github runners available
- Create a workflow that cache some folders using
${{ github.workspace }} - Have multiple matrix start and restore the said cache
- See failures on runs that are on a different type of runner than the one the cache was created on
Expected behavior
I do wonder why we actually care about the path at all when restoring?
If I did cache some folders, and I do want to restore them, shouldn't the cache key be enough to justify a proper cache match or miss?
Might be related: https://github.com/actions/toolkit/issues/1377
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the cache mismatch with self-hosted and GitHub-hosted runners, using ${{ github.workspace }} in a matrix workflow. Read the related issue in actions/toolkit#1377 and trace how @actions/cache computes its version. Done means establishing the intended role of paths and defining consistent cache restore behavior across runner types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100