Skip to content

Commit

Permalink
Add .github/actions/linkchecker/action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana committed Jul 9, 2024
1 parent c1b9208 commit a161078
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/actions/linkchecker/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Linkchecker
description: Checks the given url for broken links
inputs:
url:
description: The URL to check for broken links
required: true
ignore-urls:
description: List of space-separated URL regex patters to ignore
default: ""
runs:
using: "composite"
steps:
- name: Check
shell: sh
run: |
IGNORE_URLS=()
for url in ${{ inputs.ignore-urls }} ; do
IGNORE_URLS+=("--ignore-url=${url}")
done
URL="${{ inputs.url }}"
nix develop --no-warn-dirty --accept-flake-config --command \
linkchecker --no-warnings --check-extern --output failures "${URL}" "${IGNORE_URLS[@]}"
if [ $? -ne 0 ]; then
echo "${URL} has broken links, see output above"
exit 1
fi

0 comments on commit a161078

Please sign in to comment.