Skip to content

Commit 2f725aa

Browse files
add broken link checker bot
1 parent 4480fd5 commit 2f725aa

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/links.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Links
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
repository_dispatch:
11+
workflow_dispatch:
12+
schedule:
13+
- cron: "00 18 * * 1"
14+
15+
jobs:
16+
linkChecker:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
issues: write
20+
steps:
21+
- uses: actions/checkout@v6
22+
23+
- name: Restore lychee cache
24+
id: restore-cache
25+
uses: actions/cache/restore@v5
26+
with:
27+
path: .lycheecache
28+
key: cache-lychee-${{ github.sha }}
29+
restore-keys: cache-lychee-
30+
31+
- name: Link Checker
32+
id: lychee
33+
uses: lycheeverse/lychee-action@v2
34+
with:
35+
args: --cache --max-cache-age 7d --verbose --no-progress './**/*.md'
36+
fail: false
37+
38+
- name: Save lychee cache
39+
uses: actions/cache/save@v5
40+
if: always()
41+
with:
42+
path: .lycheecache
43+
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
44+
45+
- name: Create Issue From File
46+
if: steps.lychee.outputs.exit_code != 0
47+
uses: peter-evans/create-issue-from-file@v5
48+
with:
49+
title: Link Checker Report
50+
content-filepath: ./lychee/out.md
51+
labels: report, automated issue

0 commit comments

Comments
 (0)