Commit 2403bbed authored by Aiqiao Yan's avatar Aiqiao Yan
Browse files

Make sure ref is not null or empty

parent ccc66f76
Loading
Loading
Loading
Loading
+1 −1
Changes for dist/restore/index.js: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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) {
+1 −1
Changes for dist/save/index.js: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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) {
+1 −1
Changes for src/utils/actionUtils.ts: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ export async function resolvePaths(patterns: string[]): Promise<string[]> {
// 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<void> {