I recently noticed a strange behavior change (no more than a few days ago) in a workflow based on gradle/actions/setup-gradle@v3
(docs).
The problem is that the cache report (in Job Summary) says the cache gets read or written, but the "Caches" page claims it's empty. Just a week ago I saw the cache entries on the "Caches" page normally and I don't understand what happened to it.
A workflow triggered from the default branch correctly saves the cache entries:
Then another one triggered from a pull request targeting the default branch reads the cache:
and yet the "Caches" page shows nothing:
I'm pretty sure there were no modifications to the workflow, so I'm surprised that the "Caches" suddenly became empty. Could it be a GitHub's bug?
I tried to query the information about the cache via gh
and, surprisingly, the result was consistent with the "Caches" page:
> gh cache list
No caches found in org/repo
> gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/org/repo/actions/caches
{
"total_count": 0,
"actions_caches": []
}
Any ideas?
It turned out to be a problem with the deprecated GitHub Cache API. Updating setup-gradle@v3
to setup-gradle@v4
fixed it.
More details can be found here: https://github.com/gradle/actions/issues/553