Skip to content

Check links

Check links #226

Workflow file for this run

---
name: 'Check links'
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
schedule:
- cron: '37 11 * * 2'
permissions:
contents: read
jobs:
links:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install Python and just
uses: opensafely-core/setup-action@v1
with:
install-just: true
python-version: '3.11'
- name: Build site
env:
AccessToken: ${{ secrets.GITHUB_TOKEN }}
MKDOCS_SITE_URL: https://docs.opensafely.org
EHRQL_BRANCH: main
run: just build
- name: Move imported documentation to correct relative path
run: mv imported_docs/* docs/
# Use --max-concurrency to prevent 429 errors with OpenSAFELY Jobs.
# This workaround may not be needed in future if lychee has better rate limiting.
# https://github.com/lycheeverse/lychee/issues/36
- name: Check links
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # v1.10.0
with:
args: "--exclude-all-private --include-verbatim --max-concurrency 24 --require-https --verbose --no-progress --timeout 60 './docs/**/*.md' './docs/**/*.html' './imported_docs/**/*.md' './imported_docs/**/*.html' --exclude-path './docs/ehrql/includes/generated_docs'"
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: "Notify Slack on Failure"
if: ${{ failure() && github.event_name == 'schedule' }}
uses: zuplo/github-action-slack-notify-build@cf8e7e66a21d76a8125ea9648979c30920195552 # v2
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel_id: C0270Q313H7
status: "Check Docs Links Failure"
color: danger