Skip to content

Commit badcdc4

Browse files
authored
ci: dedupe broken-links issue and fix typecheck (#635)
* ci: reuse existing broken-links issue instead of opening a new one * build: generate fumadocs types before typecheck
1 parent 86a7e96 commit badcdc4

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎.github/workflows/links.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,30 @@ jobs:
3939
'./README.md'
4040
fail: false
4141

42+
- name: Find existing broken links issue
43+
id: existing-issue
44+
if: steps.lychee.outputs.exit_code != 0
45+
uses: actions/github-script@v7
46+
with:
47+
script: |
48+
const title = 'Broken links found in documentation'
49+
const { data: issues } = await github.rest.issues.listForRepo({
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
state: 'open',
53+
labels: 'documentation, automated',
54+
per_page: 100,
55+
})
56+
const existing = issues.find((issue) => !issue.pull_request && issue.title === title)
57+
if (existing) {
58+
core.setOutput('issue-number', String(existing.number))
59+
}
60+
4261
- name: Open or update issue on broken links
4362
if: steps.lychee.outputs.exit_code != 0
4463
uses: peter-evans/create-issue-from-file@v5
4564
with:
65+
issue-number: ${{ steps.existing-issue.outputs.issue-number }}
4666
title: Broken links found in documentation
4767
content-filepath: ./lychee/out.md
4868
labels: documentation, automated

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"optimize:images": "node scripts/optimize-images.mjs",
1313
"test": "vitest run",
1414
"test:watch": "vitest",
15-
"typecheck": "tsc --noEmit",
15+
"typecheck": "fumadocs-mdx && tsc --noEmit",
1616
"lint": "eslint --cache --max-warnings 0 .",
1717
"lint:prettier": "prettier --cache --check --ignore-path .gitignore --ignore-path .prettierignore .",
1818
"prettier": "bun run lint:prettier --write",

0 commit comments

Comments
 (0)