-
Notifications
You must be signed in to change notification settings - Fork 18
43 lines (38 loc) · 1.27 KB
/
linkchecker.yml
File metadata and controls
43 lines (38 loc) · 1.27 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
name: Validate existing links
on:
pull_request:
push:
branches-ignore:
- live
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "00 18 * * *"
jobs:
linkChecker:
permissions:
contents: write
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Resolve root-relative links for checking
run: |
# Convert root-relative markdown links like [text](/path) to [text](https://learn.microsoft.com/path)
# so lychee can validate them. This only modifies the CI checkout copy.
find . -name '*.md' -exec sed -i -E 's|\]\(/|\](https://learn.microsoft.com/|g' {} +
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@master
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
args: --config=.lychee.toml --accept=200,429,403,502,503 --verbose --no-progress './**/*.md'
fail: true
- name: Create Issue From File
if: always() && env.lychee_exit_code != 0 && github.event_name != 'pull_request'
uses: peter-evans/create-issue-from-file@main
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue