Skip to content

Check links

Check links #165

Workflow file for this run

name: Check links
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
pull_request:
branches:
- main
paths:
- '**/*.html'
- '**/*.ipynb'
- '**/*.md'
- '.github/workflows/check_links.yaml'
push:
branches:
- main
paths:
- '**/*.html'
- '**/*.ipynb'
- '**/*.md'
- '.github/workflows/check_links.yaml'
permissions:
contents: read
issues: write
env:
UV_SYSTEM_PYTHON: 1
jobs:
check_links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install uv
uses: astral-sh/setup-uv@2e657c127d5b1635d5a8e3fa40e0ac50a5bf6992 # v3.2.2
with:
enable-cache: true
cache-dependency-glob: '**/*requirements.txt'
- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.12'
cache: pip
- name: Install dependencies
run: |
uv pip install --upgrade pip setuptools wheel
uv pip install -r dev/requirements/check_links_requirements.txt
- name: Convert notebooks to markdown
run: |
find . -name "*.ipynb" -exec jupyter nbconvert --to markdown {} \;
- name: Check links with lychee
uses: lycheeverse/lychee-action@f81112d0d2814ded911bd23e3beaa9dda9093915 # v2.1.0
with:
args: |
--exclude .*\/maps\/.*\.html$
--exclude-path docs/overrides/partials/copyright.html
--exclude-path docs/overrides/partials/logo.html
--user-agent curl
.
fail: |-
${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
- name: Create issue
if: |
env.lychee_exit_code != 0 &&
(
github.event_name == 'workflow_dispatch' ||
github.event_name == 'schedule'
)
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5.0.1
with:
title: 'Check links failed'
content-filepath: ./lychee/out.md
labels: |
docs
assignees: |
mrsmrynk