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

fix cache-hit output when match isn't exact #19

Merged
merged 5 commits into from
Aug 22, 2022

Conversation

Balvajs
Copy link
Contributor

@Balvajs Balvajs commented Aug 18, 2022

The original actions/cache action is setting cache-hit to true only if the cache key was exact match:

restore-keys - An ordered list of keys to use for restoring stale cache if no cache hit occurred for key. Note cache-hit returns false in this case.

So this PR fixes the behavior and sets the cache-hit output to true just only if the cache key is exact match.

Also persist key inside state, so it's not re-evaluated in post action.
And change restore so it prioritizes cache matched with key over restore-keys.

@Balvajs Balvajs marked this pull request as ready for review August 18, 2022 20:04
@jackieli-tes
Copy link
Contributor

Hi @Balvajs , thanks very much for the contribution. All looks good. I just had to do some quick formatting. Merging after pipeline run

@jackieli-tes jackieli-tes merged commit 0de2749 into tespkg:main Aug 22, 2022
@Balvajs Balvajs deleted the fix/cache-hit branch November 24, 2022 09:15
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