Skip to content

Test for cache-hit without restoring the files #1113

@h-mayorquin

Description

@h-mayorquin

Is there a way for checking for cache-hits without restoring (downloading) the files?

My understanding now is that testing for a cache-hit and restoring (downloading) the files are coupled and I can't find in the documentation a way of separating them.

The use case is the following:

I have a centralized workflow operating in the main branch which creates consumption caches to be restored and used for testing on all the other branches. More specifically, the cache creation workflow checks if the dependencies have been updated and creates a new cache if they have and does nothing if they haven't. However, most of the times the dependencies are not updated and the cache ends up restoring the cache for no reason, that is, the restoring operation is wasted in this wokflow. Hence my question above it?

Probably this could be done by listing caches using curl or github-ci in the following way:
https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository

But I wanted to know if it could be done with this action.

Metadata

Metadata

Assignees

Labels

area:granular-controlIssues related to granular control in saving or restoring cache

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions