-
Notifications
You must be signed in to change notification settings - Fork 804
63 lines (56 loc) · 1.62 KB
/
Copy pathlinks.yml
File metadata and controls
63 lines (56 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Link Check
on:
pull_request:
branches: [main]
paths:
- "docs/**/*.md"
- "docs/**/*.mdx"
- ".lycheeignore"
- ".github/workflows/links.yml"
push:
branches: [main]
paths:
- "docs/**/*.md"
- "docs/**/*.mdx"
- ".lycheeignore"
- ".github/workflows/links.yml"
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
link-check:
name: Check links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Restore lychee cache
if: github.event_name != 'schedule'
uses: actions/cache@v5
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Run link checker
id: lychee
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2
with:
args: --accept 200,203,301..=304,403,429 --cache --max-cache-age 1d --verbose --no-progress --root-dir './docs' 'docs/**/*.md' 'docs/**/*.mdx'
fail: false
format: markdown
jobSummary: true
output: ./lychee/out.md
- name: Create issue from report
if: steps.lychee.outputs.exit_code == '2' && github.event_name == 'schedule'
uses: peter-evans/create-issue-from-file@v6
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
- name: Fail on broken links
if: steps.lychee.outputs.exit_code != '0'
run: exit 1