Skip to content

Prevent Dead links

Prevent Dead links #40

name: Prevent Dead links
# Looks in the repository for dead links in markdown and HTML files, and fails
# if links to dead websites or non-existing files are present in the
# repository.
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
branches: [main, master, release, development]
paths: [ "**/*.md", "**/*.markdown", "**/*.html", "**/*.htm" ]
push:
branches: [main, master, release, development]
paths: [ "**/*.md", "**/*.markdown", "**/*.html", "**/*.htm" ]
schedule: [cron: "0 0 * * 0"]
jobs:
check-all-the-links:
name: Check all the links
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Restore lychee cache
uses: actions/[email protected]
id: restore-cache
with:
path: .lycheecache
key: >
lychee-cache-cron-${{ hashFiles(
'**/*.md',
'**/*.markdown',
'**/*.html',
'**/*.htm'
) }}
restore-keys: lychee-cache-cron-
- name: Check the links
uses: lycheeverse/[email protected]
with:
fail: true
token: ${{ secrets.GITHUB_TOKEN }}
args: >
--glob-ignore-case **/*.{md,markdown,html,htm}
--verbose --max-concurrency 1 --hidden --cache
--max-cache-age 1d --exclude-path docs/overrides
- name: Save lychee cache
uses: actions/cache/[email protected]
with:
path: .lycheecache
key: ${{ steps.restore-cache.outputs.cache-primary-key }}