Skip to content

Check links

Check links #428

Workflow file for this run

# Checks if all links are valid, i.e. not broken
#
# Errors are reported via an Issue being created,
# instead of via en email to all repository Watchers
name: Check links
# Only run this on the main branch, or with Pull Requests
on:
schedule:
- cron: "0 9-21/3 * * *"
workflow_dispatch:
jobs:
check_links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Remove folders that need not to be checked
run: |
rm -rf docs/*/not_used/
rm -rf docs/*/may2024/
rm -rf docs/May23
rm -rf docs/May_24
rm -rf docs/feb23_course
rm -rf docs/mermaid
- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
#- name: Check RST files
# id: lychee
# uses: lycheeverse/lychee-action@v1.10.0
# with:
# # Check all reStructuredText files in repo
# args: --base docs/ --max-redirects 10 --user-agent "curl/8.4.0" --verbose --no-progress './**/*.rst'
- name: Check MD files
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: 'mlc_config.json'
use-quiet-mode: 'yes'
use-verbose-mode: 'no'
- name: Create Issue From File
if: env.lychee_exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue