From a161078b5d40ceeffba2858dc2dca02a3923ca60 Mon Sep 17 00:00:00 2001 From: zeme Date: Tue, 9 Jul 2024 11:19:10 +0200 Subject: [PATCH] Add .github/actions/linkchecker/action.yml --- .github/actions/linkchecker/action.yml | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/actions/linkchecker/action.yml 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