add support for read-only cache #995
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add support for not saving the cache.
Fixes #350
Fixes #334
Fixes #92
Similar to both #489 and #964, but here it's implemented as an input to the workflow instead of an environment variable.
Motivation and Context
I needed the behavior for this PR: github/codeql#11362.
In
github/codeqlwe have some code that gets faster by using a cache.But that code can take some shortcuts if it doesn't have to save a new cache.
So on PRs we essentially run in a "read-only" mode, where we don't expect any cache to be populated.
And we make sure that the cache is populated on pushes to
main.Our current workaround is to use a key based on the current commit SHA, which no other run will hit.
But that is currently filling up the cache space in the repo: https://github.com/github/codeql/actions/caches
How Has This Been Tested?
Types of changes
Checklist: