Skip to content
Open
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
28 changes: 28 additions & 0 deletions .github/workflows/docs-check-links.yml
Original file line number Diff line number Diff line change
@@ -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 }}

Loading