Handle the case where branches may be strings, including "*"
This commit is contained in:
parent
c6dbd5a9bf
commit
ac1c081de8
6 changed files with 66 additions and 13 deletions
12
lib/actions-util.test.js
generated
12
lib/actions-util.test.js
generated
|
|
@ -112,6 +112,18 @@ ava_1.default("validateWorkflow() when on.push is a correct object", (t) => {
|
|||
});
|
||||
t.deepEqual(errors.length, 0);
|
||||
});
|
||||
ava_1.default("validateWorkflow() when on.pull_requests is a string", (t) => {
|
||||
const errors = actionsutil.validateWorkflow({
|
||||
on: { push: { branches: ["main"] }, pull_request: { branches: "*" } },
|
||||
});
|
||||
t.deepEqual(errors, [actionsutil.WorkflowErrors.MismatchedBranches]);
|
||||
});
|
||||
ava_1.default("validateWorkflow() when on.pull_requests is a string and correct", (t) => {
|
||||
const errors = actionsutil.validateWorkflow({
|
||||
on: { push: { branches: "*" }, pull_request: { branches: "*" } },
|
||||
});
|
||||
t.deepEqual(errors, []);
|
||||
});
|
||||
ava_1.default("validateWorkflow() when on.push is correct with empty objects", (t) => {
|
||||
const errors = actionsutil.validateWorkflow({
|
||||
on: { push: undefined, pull_request: undefined },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue