Skip to content

Commit 8503390

Browse files
committed
fix: deduplicate lychee reports
1 parent 580e41d commit 8503390

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/links.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,31 @@ jobs:
2828
--exclude-path infra/docker/data
2929
'./**/*.md' './**/*.mdx'
3030
fail: false # don't fail the run; we report via an issue instead
31+
- name: Find existing broken-links issue
32+
id: find-issue
33+
if: steps.lychee.outputs.exit_code != 0
34+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
35+
with:
36+
script: |
37+
const title = 'Broken links found by lychee';
38+
const issues = await github.paginate(github.rest.issues.listForRepo, {
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
state: 'open',
42+
per_page: 100,
43+
});
44+
const existingIssue = issues.find(
45+
(issue) => !issue.pull_request && issue.title === title,
46+
);
47+
48+
if (existingIssue) {
49+
core.setOutput('issue-number', String(existingIssue.number));
50+
}
3151
- name: Open an issue on broken links
3252
if: steps.lychee.outputs.exit_code != 0
3353
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6
3454
with:
3555
title: Broken links found by lychee
3656
content-filepath: ./lychee/out.md
57+
issue-number: ${{ steps.find-issue.outputs.issue-number }}
3758
labels: documentation, broken-link

.lycheeignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111

1212
# Private repo paths (security advisories, settings) require auth.
1313
^https://github\.com/OpenMapX/openmapx/security/
14+
15+
# npm package page returns 403 to lychee although the documentation link is valid.
16+
^https://www\.npmjs\.com/package/@openmapx/extension-sdk$

0 commit comments

Comments
 (0)