Skip to content

Use case-insensitive key comparison for cache keys #660

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

Merged
merged 2 commits into from
Jul 29, 2025

Conversation

BytewaveMLP
Copy link
Contributor

@BytewaveMLP BytewaveMLP commented Oct 21, 2024

Following the discussion in #659, this PR introduces a case-insensitive cache key comparison function to compare the cache key returned from @actions/cache versus the calculated cache key for the purposes of partial-hits.

This implementation follows that which is used in actions/cache. Unfortunately, that implementation isn't in the accompanying Node package, so I've copied it here.

Closes #659

AndresMaqueo

This comment was marked as spam.

@Ctytnhhkiau23saidong

This comment was marked as spam.

Ctytnhhkiau23saidong

This comment was marked as spam.

Ctytnhhkiau23saidong

This comment was marked as spam.

@eregon
Copy link
Member

eregon commented Jul 29, 2025

Sorry for not reviewing this sooner, I think was unsure whether this was safe enough.
Since this works on GitHub Actions and act is not tested (in this repo) and so not supported I think this is something to fix in act instead.
OTOH it seems a safe enough change, and it seems nice if people can use act locally to run GitHub Actions.
It seems many places are already doing the same: https://github.com/search?q=cacheKey.localeCompare&type=code

I'll merge it, but if it causes any issues I'll revert.

@eregon eregon force-pushed the case-insensitive-key-compare branch from b4d6987 to dbd9032 Compare July 29, 2025 20:21
@eregon eregon merged commit 2a7b300 into ruby:master Jul 29, 2025
191 checks passed
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.

Cache keys are treated as case-sensitive, but case is not preserved in all environments
4 participants