1
0
mirror of synced 2025-12-30 03:01:36 -05:00

skip support.github.com in external link checker (#32015)

This commit is contained in:
Peter Bengtsson
2022-10-24 20:32:29 +02:00
committed by GitHub
parent efd174acb7
commit 99aaaea2c6
3 changed files with 17 additions and 1 deletions

View File

@@ -140,6 +140,7 @@ if (import.meta.url.endsWith(process.argv[1])) {
* verbose {boolean} - Set to true for more verbose logging
* random {boolean} - Randomize page order for debugging when true
* patient {boolean} - Wait longer and retry more times for rate-limited external URLS
* bail {boolean} - Throw an error on the first page (not permalink) that has >0 flaws
*
*/
async function main(core, octokit, uploadArtifact, opts = {}) {
@@ -529,7 +530,7 @@ function getPages(pageList, languages, filters, files, max) {
}
async function processPage(core, page, pageMap, redirects, opts) {
const { verbose, verboseUrl } = opts
const { verbose, verboseUrl, bail } = opts
const allFlawsEach = await Promise.all(
page.permalinks.map((permalink) => {
@@ -543,6 +544,13 @@ async function processPage(core, page, pageMap, redirects, opts) {
if (verbose) {
printFlaws(core, allFlaws, { verboseUrl })
}
if (bail) {
if (!verbose) {
console.warn('Use --verbose to see the flaws before it exits')
}
throw new Error(`More than one flaw in ${page.relativePath}`)
}
}
return allFlaws