generated from sosiristseng/template-mkdocs-material
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (52 loc) · 1.49 KB
/
lychee.yml
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
name: Check markdown links
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *' # Every month
push:
branches:
- main
paths:
- 'docs/**'
- '.lycheeignore'
- '.github/workflows/lychee.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linkcheck:
runs-on: ubuntu-latest
permissions:
issues: write # required for peter-evans/create-issue-from-file
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore lychee cache
id: restore-cache
uses: actions/cache/restore@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Lychee Checker
uses: lycheeverse/lychee-action@v2
id: lychee
with:
fail: false
failIfEmpty: false
args: '--accept 200,204,429 --verbose --no-progress --cache --max-cache-age 1d docs/'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Issue From File
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report
- name: Save lychee cache
uses: actions/cache/save@v4
if: always()
with:
path: .lycheecache
key: ${{ steps.restore-cache.outputs.cache-primary-key }}