-
Notifications
You must be signed in to change notification settings - Fork 65.5k
Fixed method for checking cache-hit #18524
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
Conversation
When checking cache-hit, this action will return an empty string on no hit, not 'false'. Therefore the correct method is to now check for !=true (see: https://github.com/actions/cache#Skipping-steps-based-on-cache-hit)
|
Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines. |
Automatically generated comment ℹ️This comment is automatically generated and will be overwritten every time changes are committed to this branch. The table contains an overview of files in the Content directory changesYou may find it useful to copy this table into the pull request summary. There you can edit it to share links to important articles or changes and to give a high-level overview of how the changes in your pull request support the overall goals of the pull request.
fpt: Free, Pro, Team |
|
@schneider10 Thanks so much for opening a PR! I'll get this triaged for review ⚡ |
|
Thanks for opening a pull request! We've triaged this issue for technical review by a subject matter expert 👀 |
👋 @N-Usha @bishal-pdMSFT Could you have a look at this and see if it might be a bug in the In the action's code, it does look like a |
|
Yes @lucascosti , the doc may need an update.. Including @aparna-ravindra who's verifying this from the code. |
@lucascosti, Unfortunately, the method in the test case you referred is not used in the action. The value for
However, if no cache was restored (either on the primary key or the restore-keys), then the |
Thanks a lot for confirming this, @aparna-ravindra! 🙇♂️ My next question (possibly more for @N-Usha): is this behavior deliberate? If I guess I'm trying to think of a case where returning a If it is deliberate, I'll take care of getting the docs updated (e.g. this section will also need updating) 👍 |
|
Given that there are two possible values (null and false) that indicate cache-miss, checking for |
|
This is a gentle bump for the docs team that this PR is waiting for technical review. |
|
Sounds like this is related to actions/cache#717 / actions/cache#661 (comment) |
|
This is a gentle bump for the docs team that this PR is waiting for technical review. |
|
@lucascosti Please feel free to ping if you need any more inputs from me. |
|
@lucascosti , |
Sorry, @aparna-ravindra; I've been on some extended leave and this one slipped through the cracks. I'll get this reviewed and merged. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although being able to match on a cache hit on a false result would also be ideal, these changes more accurately describe the action's current behavior. 👍
|
Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our help wanted issues ⚡ |
|
@lucascosti this PR help setting cache hit on |
|
Sorry, @bchen1029; the Actions engineering team will have to review those changes; I'm a docs writer and defer to them for any functionality changes. |
When checking cache-hit, this action will return an empty string on no hit, not 'false'. Therefore the correct method is to now check for !=true (see: https://github.com/actions/cache#Skipping-steps-based-on-cache-hit)
Why:
This doc is out of date or sharing incorrect info for the latest cache action.
What's being changed:
The documented method to check for a cache hit.
Check off the following:
Writer impact (This section is for GitHub staff members only):