1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-12-23 04:06:00 +01:00

Make sure ref is not null or empty

This commit is contained in:
Aiqiao Yan 2020-04-20 13:44:37 -04:00
parent ccc66f769e
commit 2403bbedac
3 changed files with 3 additions and 3 deletions

View file

@ -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) {

2
dist/save/index.js vendored
View file

@ -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) {

View file

@ -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> {