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

Set output cache-hit to indicate if cache was hit #275

Merged

Conversation

schuenadel
Copy link
Contributor

@schuenadel schuenadel commented Jan 13, 2022

Description:
Add the cache-hit output to be able to execute later steps depending on if the cache was hit like it is possible with actions/cache. Like described here: https://github.com/actions/cache/tree/main#Skipping-steps-based-on-cache-hit

Related issue:
None
Edit: Later this issue came up, which is addressed here: #306

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@dmitry-shibanov
Copy link
Contributor

Hello @schuenadel. Thank you for your pull request. Could you please add check that matchedKey and primaryKey are equal, because for now the cache can hit for the restore key.

@schuenadel
Copy link
Contributor Author

Could you please add check that matchedKey and primaryKey are equal, because for now the cache can hit for the restore key.

Thanks, that makes sense. I misunderstood the return value of restoreCache to only return on a "real" cache hit. Fixed that in edfea5c

@schuenadel
Copy link
Contributor Author

@dmitry-shibanov Is there anything else needed to get this merged? Asking because I don't have the rights to merge.

@dmitry-shibanov
Copy link
Contributor

Hello @schuenadel. Sorry for the late response. Could you please sync with the main branch ?

@schuenadel schuenadel requested a review from a team April 4, 2022 13:22
@schuenadel
Copy link
Contributor Author

Hi @dmitry-shibanov

Could you please sync with the main branch ?

👍 Just did that

@dmitry-shibanov dmitry-shibanov merged commit d2e3f41 into actions:main Apr 7, 2022
@schuenadel schuenadel deleted the set-cache-hit-status-as-output branch April 8, 2022 07:54
ansraliant added a commit to ansraliant/setup-java that referenced this pull request Aug 23, 2022
Cache hit was being used as stated in this pr
actions#275.
However, it was not included in the outputs of the action. It did not
cause any mayor issues, but if you were to lint the workflows, then an
output not defined error would pop up.
This Commit just adds the output to the list. Nothing more
@ansraliant ansraliant mentioned this pull request Aug 23, 2022
2 tasks
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.

None yet

3 participants