diff --git a/.github/actions/linkchecker/action.yml b/.github/actions/linkchecker/action.yml new file mode 100644 index 00000000000..bfc6d2aeba2 --- /dev/null +++ b/.github/actions/linkchecker/action.yml @@ -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 \ No newline at end of file