Skip to content

Commit

Permalink
Include exit code in debug output
Browse files Browse the repository at this point in the history
ESLint will return exit code 2 if something completely breaks during
parsing. Let's make sure that's exposed if we're looking for it.
  • Loading branch information
sheck committed Oct 8, 2024
1 parent 436d9d9 commit 8c1391e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/index.js

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

3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ async function run() {

core.debug(`Changed files: ${changedFiles}`)

let { stdout: eslintOut } = await getExecOutput(
let { stdout: eslintOut, exitCode } = await getExecOutput(
"npx eslint --format=json",
changedFiles,
// Eslint will return exit code 1 if it finds linting problems, but that is
// expected and we don't want to stop execution because of it.
{ ignoreReturnCode: true },
)
let eslintJson = JSON.parse(eslintOut)
core.debug(`Eslint exit code: ${exitCode}`)

let promises: Array<Promise<EslintResult>> = eslintJson.map(
(resultObject: ResultObject) => EslintResult.for(resultObject, compareSha),
Expand Down

0 comments on commit 8c1391e

Please sign in to comment.