Skip to content

dispatch-website-linkcheck #740

dispatch-website-linkcheck

dispatch-website-linkcheck #740

Workflow file for this run

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.com | 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