Skip to content

Commit 1922e36

Browse files
author
Peter Bengtsson
authored
Count unique links broken rather than pages it appears on (#43796)
1 parent 93a1667 commit 1922e36

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/links/scripts/rendered-content-link-checker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ async function main(core, octokit, uploadArtifact, opts = {}) {
261261

262262
summarizeFlaws(core, flaws)
263263

264+
const uniqueHrefs = new Set(flaws.map((flaw) => flaw.href))
265+
264266
if (flaws.length > 0) {
265267
await uploadJsonFlawsArtifact(uploadArtifact, flaws, opts)
266268
core.info(`All flaws written to artifact log.`)
@@ -269,7 +271,7 @@ async function main(core, octokit, uploadArtifact, opts = {}) {
269271
const reportProps = {
270272
core,
271273
octokit,
272-
reportTitle: `${flaws.length} broken links found`,
274+
reportTitle: `${uniqueHrefs.size} broken links found`,
273275
reportBody: flawIssueDisplay(flaws, opts),
274276
reportRepository,
275277
reportLabel,

0 commit comments

Comments
 (0)