Skip to content

Link checker GitHub Action #4

Link checker GitHub Action

Link checker GitHub Action #4

name: Check for broken links
on:
workflow_dispatch: # Triggered manually. In GitHub repository, go to Actions tab > click 'Check for broken links' in sidebar > click 'Run workflow' at the top of the page.
pull_request:
branches:
- main
jobs:
link-checker:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Check links
id: check-links
uses: lycheeverse/lychee-action@v2
with:
fail: false
output: /tmp/broken-links-report.md
args: >
--exclude-path ./docs/data/archive
--exclude-path ./docs/data/version-history
--exclude-path ./docs/tech-alerts
./**/*.md ./**/*.rst ./**/*.ipynb ./**/*.yaml ./**/*.yml
- name: Create issue
if: steps.check-links.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Fix broken links
content-filepath: /tmp/broken-links-report.md
labels: link-checker