diff --git a/dist/index.js b/dist/index.js index e5a95e1..80a2528 100644 --- a/dist/index.js +++ b/dist/index.js @@ -398,6 +398,7 @@ const readAnnotationsFile= async function(inputPath) { } catch (err) { if (err.code === 'ENOENT' && ignoreMissingFile) { core.info(`Ignoring missing file at '${inputPath}' because \'ignore-missing-file\' is true`) + return null } else { throw err } @@ -416,6 +417,9 @@ async function run () { const repo = github.context.repo.repo const annotations = await readAnnotationsFile(inputPath) + if (annotations === null) { + return + } const checkRunId = await createCheck(octokit, owner, repo, title, ref) const { failureCount, warningCount, noticeCount } = stats(annotations) core.info(`Found ${failureCount} failure(s), ${warningCount} warning(s) and ${noticeCount} notice(s)`) diff --git a/index.js b/index.js index 4a711c3..2a0897e 100644 --- a/index.js +++ b/index.js @@ -125,6 +125,7 @@ const readAnnotationsFile= async function(inputPath) { } catch (err) { if (err.code === 'ENOENT' && ignoreMissingFile) { core.info(`Ignoring missing file at '${inputPath}' because \'ignore-missing-file\' is true`) + return null } else { throw err } @@ -143,6 +144,9 @@ async function run () { const repo = github.context.repo.repo const annotations = await readAnnotationsFile(inputPath) + if (annotations === null) { + return + } const checkRunId = await createCheck(octokit, owner, repo, title, ref) const { failureCount, warningCount, noticeCount } = stats(annotations) core.info(`Found ${failureCount} failure(s), ${warningCount} warning(s) and ${noticeCount} notice(s)`)