Workflow triggers are null if unspecified

This commit is contained in:
Simon Engledew 2020-11-24 10:25:58 +00:00
parent c0bd7b0b2b
commit 754f502a84
No known key found for this signature in database
GPG key ID: 84302E7B02FE8BCE
6 changed files with 45 additions and 14 deletions

View file

@ -146,6 +146,15 @@ ava_1.default("validateWorkflow() when on.push is mismatched for pull_request",
});
t.deepEqual(errors, [actionsutil.ErrMismatchedBranches]);
});
ava_1.default("validateWorkflow() when on.pull_request for every branch but push specifies branches", (t) => {
const errors = actionsutil.validateWorkflow({
on: {
push: { branches: ["main"] },
pull_request: null,
},
});
t.deepEqual(errors, [actionsutil.ErrMismatchedBranches]);
});
ava_1.default("validateWorkflow() when HEAD^2 is checked out", (t) => {
const errors = actionsutil.validateWorkflow({
on: ["push", "pull_request"],