Skip to content

Check links

Check links #104

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@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: '**/*requirements.txt'
- name: Set up Python 3.12
uses: actions/setup-python@v5
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@v2
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@v5
with:
title: 'Check links failed'
content-filepath: ./lychee/out.md
labels: |
docs
assignees: |
mrsmrynk