world-federation-of-advertisers / cross-media-measurement

A privacy centric system for cross publisher, cross media ads measurement through secure multiparty computations.
https://halo.wfanet.org/
Apache License 2.0
36 stars 11 forks source link

ci: Image scanning GitHub Action does not see cached DB #1891

Closed SanjayVas closed 3 weeks ago

SanjayVas commented 3 weeks ago

The scan-images workflow which uses aquasecurity/trivy-action is not seeing the cached DB from the update-trivy-cache workflow. This was added in #1878 following documentation from the Trivy action. This includes when the update-trivy-cache workflow is run on the same ref as the scan-images workflow.

Cache not found for input keys: cache-trivy-2024-10-31, cache-trivy-

image

SanjayVas commented 3 weeks ago

Seeing the following with debug logging:

##[debug]No matching cache found for cache key 'cache-trivy-2024-10-29', version 'cfdc2bcf67bb1c3559bbfba62a7ed98abe2868ecc65f79ee627e58280adbf4d3 and scope refs/tags/nightly/20241028.1. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key 
##[debug]Other caches with similar key:
##[debug]Cache Key: cache-trivy-2024-10-29, Cache Version: 07dc9f6516584e901e644e11f92897f94dbdb6b82f1dda2bb2c3e7fd20bb931a, Cache Scope: refs/heads/main, Cache Created: 2024-10-29T05:13:41.6566667Z

I'm not sure why it's claiming it's a different version or scope, as the default branch (refs/heads/main) should always be in scope.

SanjayVas commented 3 weeks ago

Filed https://github.com/actions/cache/issues/1491 since according to the documentation, this should work.