Skip to content

Commit be7bb77

Browse files
committed
Attempt to short-circuit reporting tool when it gets an invalid file
1 parent f07e3c5 commit be7bb77

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/validate-pr/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ async function run() {
9191
if (file.startsWith('specification/_doc_ids')) continue
9292
if (file.startsWith('specification/_json_spec')) continue
9393
if (file.startsWith('specification/node_modules')) continue
94-
if (file === 'specification/tsconfig.json') continue
95-
if (file === 'specification/eslint.config.js') continue
96-
if (file === 'specification/package.json') continue
97-
if (file === 'specification/package-lock.json') continue
94+
if (file.endsWith('tsconfig.json')) continue
95+
if (file.endsWith('eslint.config.js')) continue
96+
if (file.endsWith('package.json')) continue
97+
if (file.endsWith('package-lock.json')) continue
9898
if (getApi(file).endsWith('_types')) {
9999
const apis = specification.endpoints
100100
.filter(endpoint => endpoint.name.split('.').filter(s => !privateNames.includes(s))[0] === getApi(file).split('.')[0])
@@ -161,6 +161,8 @@ function buildTableLine (api, report) {
161161
}
162162

163163
function generateStatus (report) {
164+
if (report.diagnostics == null) return 'n/a'
165+
164166
if (!report.diagnostics.hasRequestType || !report.diagnostics.hasResponseType) {
165167
return ':orange_circle:'
166168
}

0 commit comments

Comments
 (0)