diff --git a/src/utils.ts b/src/utils.ts index 6f245609..6e38d28b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -285,6 +285,9 @@ ${evalStr} static evaluateRuleExist (cwd: string, ruleExists: string[] | undefined): boolean { if (ruleExists === undefined) return true; for (const pattern of ruleExists) { + if (pattern == "") { + continue; + } if (globby.sync(pattern, {dot: true, cwd}).length > 0) { return true; } diff --git a/tests/test-cases/rules-exists/.gitlab-ci.yml b/tests/test-cases/rules-exists/.gitlab-ci.yml index 7f80d46b..f9b87498 100644 --- a/tests/test-cases/rules-exists/.gitlab-ci.yml +++ b/tests/test-cases/rules-exists/.gitlab-ci.yml @@ -56,3 +56,10 @@ var-expand-test: rules: - exists: - ${DIR}/recursive.file + +rule-exist-empty-string: + script: + - echo "$CI_JOB_NAME Executed!" + rules: + - exists: + - "" diff --git a/tests/test-cases/rules-exists/integration.test.ts b/tests/test-cases/rules-exists/integration.test.ts index efeef958..75c5c46b 100644 --- a/tests/test-cases/rules-exists/integration.test.ts +++ b/tests/test-cases/rules-exists/integration.test.ts @@ -21,4 +21,5 @@ test("rules-exists", async () => { expect(output).not.toContain("File Skipped!"); expect(output).not.toContain("Directory Skipped!"); expect(output).not.toContain("Directory Recursive Skipped!"); + expect(output).not.toContain("rule-exist-empty-string Executed!"); });