-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.59 KB
/
many--prevent-dead-links.yaml
File metadata and controls
51 lines (48 loc) · 1.59 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
name: Prevent Dead links
# Looks in the repository for dead links in markdown and HTML files, and fails
# if links to dead websites or non-existing files are present in the
# repository.
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
branches: [main, master, release, development]
paths: [ "**/*.md", "**/*.markdown", "**/*.html", "**/*.htm" ]
push:
branches: [main, master, release, development]
paths: [ "**/*.md", "**/*.markdown", "**/*.html", "**/*.htm" ]
schedule: [cron: "0 0 * * 0"]
jobs:
check-all-the-links:
name: Check all the links
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Restore lychee cache
uses: actions/[email protected]
id: restore-cache
with:
path: .lycheecache
key: >
lychee-cache-cron-${{ hashFiles(
'**/*.md',
'**/*.markdown',
'**/*.html',
'**/*.htm'
) }}
restore-keys: lychee-cache-cron-
- name: Check the links
uses: lycheeverse/[email protected]
with:
fail: true
token: ${{ secrets.GITHUB_TOKEN }}
args: >
--glob-ignore-case **/*.{md,markdown,html,htm}
--verbose --max-concurrency 1 --hidden --cache
--max-cache-age 1d --exclude-path docs/overrides
- name: Save lychee cache
uses: actions/cache/[email protected]
with:
path: .lycheecache
key: ${{ steps.restore-cache.outputs.cache-primary-key }}