Skip to content

Commit f1c94d6

Browse files
authored
Feat: Integrate Lychee to Automate Broken URL Checks (#7486)
* add auto check * pre-commit
1 parent 36f85f4 commit f1c94d6

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/workflows/link-check.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Link Checker
2+
3+
on:
4+
repository_dispatch:
5+
push:
6+
branches:
7+
- develop
8+
workflow_dispatch:
9+
schedule:
10+
- cron: "00 18 * * 0"
11+
12+
jobs:
13+
linkChecker:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Link Checker
19+
id: lychee
20+
uses: lycheeverse/lychee-action@v2
21+
env:
22+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
23+
with:
24+
args: --verbose --no-progress --max-redirects 8 './**/*.md'
25+
format: markdown
26+
fail: false
27+
output: lychee/results.md
28+
29+
- name: Create Issue From File
30+
if: steps.lychee.outputs.exit_code != 0
31+
uses: peter-evans/create-issue-from-file@v5
32+
with:
33+
title: Link Checker Report
34+
content-filepath: ./lychee/results.md
35+
labels: report, automated issue

.lycheeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
zhuanlan.zhihu.com/*
2+
https://demo.doctrp.top/
3+
http://127.0.0.1:8001/
4+
http://localhost:9003

0 commit comments

Comments
 (0)