Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention empty possibility for outputs.cache-hit #1160

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rikhuijzer
Copy link

The outputs.cache-hit used to indicate that the value is a boolean, which means true or false. However, outputs.cache-hit is not set when there is no cache restored. I discovered this the hard way and also @aparna-ravindra mentioned it in github/docs#18524 (comment):

However, if no cache was restored (either on the primary key or the restore-keys), then the cache-hit output value is not set.

@rikhuijzer rikhuijzer requested a review from a team as a code owner April 24, 2023 07:24
@rgrunber
Copy link

I also discovered this the hard way 🤣 It looks like there's #876 to correct the issue ?

Although it's true the documentation at https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-output-of-the-cache-action speaks only about true, a consumer of the action might easily interpret that as just because that's the example that was chosen. Using true brings along the implicit assumption that the negation of the precondition (no cache hit) will be false. If it's not the case, then that probably deserves a special note in the documentation.

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