Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/docs-check-links.sh
Original file line number Diff line number Diff line change
@@ -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}" != good_links ]]; then
echo "One or more links in the documentation failed:" >&2
echo $link_code >&2
exit 1
fi

exit 0
11 changes: 11 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ permissions:
contents: read
jobs:

link-checker:
if: ${{ always() }}
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 }}

test-build-docs:
if: ${{ always() }}
name: Without ctsm_pylib or container
Expand Down
Loading