Skip to content

Commit

Permalink
Make sure ref is not null or empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiqiao Yan authored and Aiqiao Yan committed May 11, 2020
1 parent ccc66f7 commit 2403bbe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/actionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 2403bbe

Please sign in to comment.