Skip to content

Daily: Link Check

Daily: Link Check #42

name: "Daily: Link Check"
on:
schedule:
- cron: '3 14 * * *'
concurrency:
group: 'ci-${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
jobs:
linkcheck:
runs-on: ubuntu-24.04
continue-on-error: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.failOnError == 'true') }}
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Install Python 3.10"
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.10.8'
- name: Install tox
run: pip install tox
- name: Run Sphinx linkcheck
run: tox -e linkcheck | tee output.txt
- name: Check for broken links below threshold
run: |
broken_count=$(grep -c "broken" output.txt)
if [[ $broken_count -ge 5 ]]; then
echo "Too many broken links detected: $broken_count"
broken_matches=$(grep "broken" output.txt)
echo "Broken links \n$broken_matches"
exit 1
else
echo "Number of broken links is below threshold: $broken_count"
fi