-
Notifications
You must be signed in to change notification settings - Fork 307
60 lines (52 loc) · 1.52 KB
/
links.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
56
57
58
59
60
name: Check Broken Links
on:
workflow_dispatch:
schedule:
- cron: "0 5 * * SUN" # at 5am on Sundays
jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- name: Restore lychee cache
id: restore-cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- uses: actions/checkout@v4
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
args: >-
--verbose
--no-progress
--cache --max-cache-age 1d
'./**/*.html'
'./**/*.js'
'./**/*.md'
'./**/*.rst'
'./**/*.tsx'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Check Output Size and Exit If Too Large
id: wc
shell: bash
run: |
# See https://github.com/peter-evans/create-issue-from-file/issues/1049
if [ "$(wc -m < ./lychee/out.md)" -gt 65536 ]; then
echo "Link Checker output is too big (> 65536 characters) for a GitHub Issue descriptions."
exit 1
fi
createIssue:
runs-on: ubuntu-latest
needs: linkChecker
steps:
- name: Create Issue From File
if: env.lychee_exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: bug, automated issue