Skip to content

Add a user agent

Add a user agent #2

name: External Links Checker (Lychee)
on:
push:
branches:
- "external-links-checker-lychee"
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "59 23 * * 0"
jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Link Checker
run: |
docker run --rm \
-v ${{ github.workspace }}:/data \
khadni/lychee-amd64:latest \
--base /data \
--quiet \
--no-progress \
'/data/**/*.md' \
'/data/**/*.mdx' \
'/data/**/*.astro' \
'/data/**/*.html' \
--exclude '(^(file://)|http://127.0.0.1:\d+|https://127.0.0.1:\d+|http://localhost:\d+|https://localhost:\d+)'
--accept '403, 429' \
--format markdown \
--user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3" | tee -a $GITHUB_STEP_SUMMARY
EXIT_CODE=${PIPESTATUS[0]}
echo "Exit code: $EXIT_CODE"
if [ "$EXIT_CODE" != "0" ]; then
exit $EXIT_CODE
fi