-
Notifications
You must be signed in to change notification settings - Fork 181
46 lines (39 loc) · 1.29 KB
/
link-checker-prs.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
# This link check is run on all PRs but just for the files that were changed/added in the PR itself.
# Otherwise we had it too often that PR authors would see a failing link check that had nothing to do with their PR.
name: Link Check PR
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
- name: Filter markdown files only
run: |
md_files=`find ${{ steps.changed-files.outputs.all_changed_files }} -maxdepth 0 -name "*.md" | tr '\n' ' '`
echo "MARKDOWN_FILES=$md_files" >> $GITHUB_ENV
- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- if: ${{ env.MARKDOWN_FILES != '' }}
name: Link Checker
uses: lycheeverse/[email protected]
with:
args: --verbose --no-progress --exclude-mail --cache --max-cache-age 1d $MARKDOWN_FILES
fail: true
jobSummary: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}