Skip to content

Commit

Permalink
Set Actions failure instead of throwing when error is matched
Browse files Browse the repository at this point in the history
  • Loading branch information
angelapwen committed Dec 1, 2022
1 parent 212a20b commit e455355
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/toolrunner-error-catcher.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/toolrunner-error-catcher.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/toolrunner-error-catcher.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as core from "@actions/core";
import * as im from "@actions/exec/lib/interfaces";
import * as toolrunner from "@actions/exec/lib/toolrunner";
import * as safeWhich from "@chrisgavin/safe-which";
Expand Down Expand Up @@ -70,7 +71,7 @@ export async function toolrunnerErrorCatcher(
matcher.outputRegex?.test(stderr) ||
matcher.outputRegex?.test(stdout)
) {
throw new Error(matcher.message);
core.setFailed(matcher.message);
}
}
}
Expand Down

0 comments on commit e455355

Please sign in to comment.