diff --git a/dist/restore/index.js b/dist/restore/index.js index 75c68a3..8acf822 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -3309,7 +3309,7 @@ exports.resolvePaths = resolvePaths; // Cache token authorized for all events that are tied to a ref // See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context function isValidEvent() { - return constants_1.RefKey in process.env; + return constants_1.RefKey in process.env && Boolean(process.env[constants_1.RefKey]); } exports.isValidEvent = isValidEvent; function unlinkFile(path) { diff --git a/dist/save/index.js b/dist/save/index.js index a5087f6..549a813 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -3309,7 +3309,7 @@ exports.resolvePaths = resolvePaths; // Cache token authorized for all events that are tied to a ref // See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context function isValidEvent() { - return constants_1.RefKey in process.env; + return constants_1.RefKey in process.env && Boolean(process.env[constants_1.RefKey]); } exports.isValidEvent = isValidEvent; function unlinkFile(path) { diff --git a/src/utils/actionUtils.ts b/src/utils/actionUtils.ts index 1a04492..50a5ef7 100644 --- a/src/utils/actionUtils.ts +++ b/src/utils/actionUtils.ts @@ -115,7 +115,7 @@ export async function resolvePaths(patterns: string[]): Promise { // Cache token authorized for all events that are tied to a ref // See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context export function isValidEvent(): boolean { - return RefKey in process.env; + return RefKey in process.env && Boolean(process.env[RefKey]); } export function unlinkFile(path: fs.PathLike): Promise {