Skip to content

Commit

Permalink
Add .github/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 db5cabb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/actions/linkchecker/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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 db5cabb

Please sign in to comment.