Implement cache skipping

This commit is contained in:
Tomas Dabasinskas 2021-10-15 13:37:59 +03:00 committed by Sergey Vilgelm
parent bb5270559b
commit 2d2273ad58
No known key found for this signature in database
GPG key ID: 08D0E2FF778887E6

View file

@ -72,6 +72,9 @@ async function buildCacheKeys(): Promise<string[]> {
} }
export async function restoreCache(): Promise<void> { export async function restoreCache(): Promise<void> {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
return
if (!utils.isValidEvent()) { if (!utils.isValidEvent()) {
utils.logWarning( 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.` `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 +115,9 @@ export async function restoreCache(): Promise<void> {
} }
export async function saveCache(): 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 // Validate inputs, this can cause task failure
if (!utils.isValidEvent()) { if (!utils.isValidEvent()) {
utils.logWarning( utils.logWarning(