Skip to content

Commit ec14845

Browse files
committed
Stop processing if file is missing
1 parent fad0bc6 commit ec14845

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

dist/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ const readAnnotationsFile= async function(inputPath) {
398398
} catch (err) {
399399
if (err.code === 'ENOENT' && ignoreMissingFile) {
400400
core.info(`Ignoring missing file at '${inputPath}' because \'ignore-missing-file\' is true`)
401+
return null
401402
} else {
402403
throw err
403404
}
@@ -416,6 +417,9 @@ async function run () {
416417
const repo = github.context.repo.repo
417418

418419
const annotations = await readAnnotationsFile(inputPath)
420+
if (annotations === null) {
421+
return
422+
}
419423
const checkRunId = await createCheck(octokit, owner, repo, title, ref)
420424
const { failureCount, warningCount, noticeCount } = stats(annotations)
421425
core.info(`Found ${failureCount} failure(s), ${warningCount} warning(s) and ${noticeCount} notice(s)`)

index.js

+4
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ const readAnnotationsFile= async function(inputPath) {
125125
} catch (err) {
126126
if (err.code === 'ENOENT' && ignoreMissingFile) {
127127
core.info(`Ignoring missing file at '${inputPath}' because \'ignore-missing-file\' is true`)
128+
return null
128129
} else {
129130
throw err
130131
}
@@ -143,6 +144,9 @@ async function run () {
143144
const repo = github.context.repo.repo
144145

145146
const annotations = await readAnnotationsFile(inputPath)
147+
if (annotations === null) {
148+
return
149+
}
146150
const checkRunId = await createCheck(octokit, owner, repo, title, ref)
147151
const { failureCount, warningCount, noticeCount } = stats(annotations)
148152
core.info(`Found ${failureCount} failure(s), ${warningCount} warning(s) and ${noticeCount} notice(s)`)

0 commit comments

Comments
 (0)