actions / actions/cache

Documentation is unclear about `cache-hit`'s value when the cache misses.

Open
#1,513 1 comment 3 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

In some places it is stated that cache-hit evaluates to the empty string when if fails, notably here:

However this would appear to contradict this other statement:

I am assuming that the latter is a mistake and the former is the intended behavior (mainly based on the comments of the issue linked above). Is this assumption correct or am I missing something?

Is there any specific moment in the codebase where the empty string is returned? I was not able to find it. Do note that I am not too familiar with typescript. AFAIK, it would seem that the only places where cache-hit is set are:

Furthermore, are there any examples in how to handle the case when the cacheHit evaluates to the empty string? I could only find examples where that variable is tested for "true" or "false".

Thanks in advance!

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

Review the contradictory cache-hit statements in README.md, then inspect src/restoreImpl.ts and src/utils/actionUtils.ts to reconcile the documented behavior with the implementation. Check existing examples for handling the output values. Done means the README consistently explains the value on a cache miss and shows how to use it.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.