Skip to content

cache-hit is false on case-insensitive cache key match #302

@kbriggs

Description

@kbriggs

Description

Some self-hosted (or otherwise non-github-hosted) runners are non-case-preserving for cache keys. In such configurations, the cache-hit output variable is currently set to false instead of true, even though the case provider did find an exact match (albeit not a case-sensitive one).

For example, in my codeberg-hosted action:

Cache Configuration
Cache Provider:
    github
…
Restore Key:
    v0-rust-cargodeps-Linux-x64-345d6b90
Cache Key:
    v0-rust-cargodeps-Linux-x64-345d6b90-10ea9ea9
.. Prefix:
  - v0-rust-cargodeps-Linux-x64
.. Environment considered:
  - Rust Version: 1.92.0 x86_64-unknown-linux-gnu (ded5c06cf21d2b93bffd5d884aa6e96934ee4234)
…
... Restoring cache ...
Cache Size: ~157 MB (165006101 B)
[command]/usr/bin/tar -xf /tmp/d6553c1f-2a84-47f5-b618-d056b98a1519/cache.tzst -P -C /workspace/kbriggs/airtouch5 --use-compress-program unzstd
Cache restored successfully
Restored from cache key "v0-rust-cargodeps-linux-x64-345d6b90-10ea9ea9" full match: false.

(note the capital L in the OS name in the generated cache key, verses the lowercase l in the returned match)

Expected behaviour

cache-hit is set to true when the found cache key differs only in case, but is otherwise identical.

Prior art

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions