-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |