Allow to disable caching completely (#351)

* Add skip-cache parameter

* Update README

* Implement cache skipping

* Run prettier

* update descriptions

* re-build dist

Co-authored-by: Sergey Vilgelm <sergey@vilgelm.com>
This commit is contained in:
Tomas Dabasinskas
2022-02-26 18:16:23 +02:00
committed by GitHub
parent 7d5614c3eb
commit cdfc708aeb
5 changed files with 22 additions and 0 deletions

View File

@ -72,6 +72,8 @@ async function buildCacheKeys(): Promise<string[]> {
}
export async function restoreCache(): Promise<void> {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return
if (!utils.isValidEvent()) {
utils.logWarning(
`Event Validation Error: The event type ${process.env[Events.Key]} is not supported because it's not tied to a branch or tag ref.`
@ -112,6 +114,8 @@ export async function restoreCache(): Promise<void> {
}
export async function saveCache(): Promise<void> {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return
// Validate inputs, this can cause task failure
if (!utils.isValidEvent()) {
utils.logWarning(