-
Notifications
You must be signed in to change notification settings - Fork 36
29 lines (29 loc) · 899 Bytes
/
linkchecker.yml
File metadata and controls
29 lines (29 loc) · 899 Bytes
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
name: Broken link check
on:
repository_dispatch:
types: [dispatch-website-linkcheck]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: update
run: sudo apt-get update
- name: check if apt can find linkchecker
run: sudo apt-cache search linkchecker
- name: install linkchecker
run: sudo apt-get install w3c-linkchecker
- name: start check
run: |
checklink -r -s -b https://devonfw.github.io | tee output.txt
- name: parse check output
run: |
output=$(cat output.txt)
if [[ $output == *"Code: 404 Not Found"* ]]; then
echo "Broken link"
exit 1
fi
if [[ $output == *"To do: Some of the links to this resource point to broken URI fragments"* ]]; then
echo "Broken fragment"
exit 2
fi