From 33a052ce22f49c2594e0b68b70d5379d7e950e59 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 20 Mar 2026 11:12:41 -0600 Subject: [PATCH 1/2] Add docs-check-links.yml and .sh files in .github/workflows --- .github/workflows/docs-check-links.sh | 18 +++++++++++++++++ .github/workflows/docs-check-links.yml | 28 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100755 .github/workflows/docs-check-links.sh create mode 100644 .github/workflows/docs-check-links.yml diff --git a/.github/workflows/docs-check-links.sh b/.github/workflows/docs-check-links.sh new file mode 100755 index 0000000000..c82d8c8053 --- /dev/null +++ b/.github/workflows/docs-check-links.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -e + +# Check that documentation links work + +# The next line returns code 200 only if the page exists +link_code="$(curl -s -o /dev/null -w "%{http_code}" $URL)" + +# Find bad links +set +e +good_links="200" +if [[ "${link_code}" != "200" ]]; then + echo "One or more links in the documentation failed:" >&2 + echo $link_code >&2 + exit 1 +fi + +exit 0 diff --git a/.github/workflows/docs-check-links.yml b/.github/workflows/docs-check-links.yml new file mode 100644 index 0000000000..c6bf847280 --- /dev/null +++ b/.github/workflows/docs-check-links.yml @@ -0,0 +1,28 @@ +name: Check documentation links + +on: + push: + # Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed. + branches: ['*'] + paths: + - 'doc/**' + + pull_request: + # Run on pull requests that change the listed files + paths: + - 'doc/**' + + # Allows user to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + link-checker: + runs-on: ubuntu-latest + steps: + - name: Check documentation links + run: | + .github/workflows/docs-check-links.sh + env: + # Use GITHUB_TOKEN to avoid rate limiting when checking GitHub links + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + From 701df18acee8a8b5569f7018095150d55f62ebfb Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 20 Mar 2026 11:48:06 -0600 Subject: [PATCH 2/2] Replace hardwiring with variable name --- .github/workflows/docs-check-links.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs-check-links.sh b/.github/workflows/docs-check-links.sh index c82d8c8053..888c114826 100755 --- a/.github/workflows/docs-check-links.sh +++ b/.github/workflows/docs-check-links.sh @@ -9,7 +9,7 @@ link_code="$(curl -s -o /dev/null -w "%{http_code}" $URL)" # Find bad links set +e good_links="200" -if [[ "${link_code}" != "200" ]]; then +if [[ "${link_code}" != good_links ]]; then echo "One or more links in the documentation failed:" >&2 echo $link_code >&2 exit 1