Skip to content

Commit 7730ed4

Browse files
committed
fix(ci): validate workflow expression capture
Punchcard-Session: amber-workshop-workshop-36
1 parent a7d2791 commit 7730ed4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎test/scripts/ci-workflow-guards.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ function evaluateWorkflowExpression(
8686
if (!match) {
8787
throw new Error(`invalid workflow expression: ${expression}`);
8888
}
89-
return runInNewContext(match[1], {
89+
const source = match[1];
90+
if (source === undefined) {
91+
throw new Error(`workflow expression has no body: ${expression}`);
92+
}
93+
return runInNewContext(source, {
9094
github: {
9195
event_name: context.eventName,
9296
repository: context.repository,

0 commit comments

Comments
 (0)