Do not report warning: undefined
This commit is contained in:
parent
6408d72268
commit
1f07e287da
6 changed files with 15 additions and 4 deletions
2
lib/actions-util.js
generated
2
lib/actions-util.js
generated
|
|
@ -266,7 +266,7 @@ async function validateWorkflow() {
|
|||
}
|
||||
core.warning(message);
|
||||
}
|
||||
return `warning: ${formatWorkflowCause(workflowErrors)}`;
|
||||
return formatWorkflowCause(workflowErrors);
|
||||
}
|
||||
exports.validateWorkflow = validateWorkflow;
|
||||
function formatWorkflowErrors(errors) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
4
lib/actions-util.test.js
generated
4
lib/actions-util.test.js
generated
|
|
@ -261,6 +261,10 @@ ava_1.default("formatWorkflowErrors() when there are multiple errors", (t) => {
|
|||
]);
|
||||
t.true(message.startsWith("2 issues were detected with this workflow:"));
|
||||
});
|
||||
ava_1.default("formatWorkflowCause() with no errors", (t) => {
|
||||
const message = actionsutil.formatWorkflowCause([]);
|
||||
t.deepEqual(message, undefined);
|
||||
});
|
||||
ava_1.default("formatWorkflowCause()", (t) => {
|
||||
const message = actionsutil.formatWorkflowCause([
|
||||
actionsutil.WorkflowErrors.CheckoutWrongHead,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -403,6 +403,13 @@ test("formatWorkflowErrors() when there are multiple errors", (t) => {
|
|||
t.true(message.startsWith("2 issues were detected with this workflow:"));
|
||||
});
|
||||
|
||||
test("formatWorkflowCause() with no errors", (t) => {
|
||||
const message = actionsutil.formatWorkflowCause([
|
||||
]);
|
||||
|
||||
t.deepEqual(message, undefined);
|
||||
});
|
||||
|
||||
test("formatWorkflowCause()", (t) => {
|
||||
const message = actionsutil.formatWorkflowCause([
|
||||
actionsutil.WorkflowErrors.CheckoutWrongHead,
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ export async function validateWorkflow(): Promise<undefined | string> {
|
|||
core.warning(message);
|
||||
}
|
||||
|
||||
return `warning: ${formatWorkflowCause(workflowErrors)}`;
|
||||
return formatWorkflowCause(workflowErrors);
|
||||
}
|
||||
|
||||
export function formatWorkflowErrors(errors: CodedError[]): string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue