Skip to content

Link checker GitHub Action #2

Link checker GitHub Action

Link checker GitHub Action #2

name: Check for broken links
on:
workflow_dispatch: # Triggered manually from the Actions tab of the GitHub repository.
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: ./check-links-output/report.md
args: >
--exclude-path ./docs/data/archive
--exclude-path ./docs/data/version-history
--exclude-path ./docs/tech-alerts
./**/*.md ./**/*.rst ./**/*.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: ./check-links-output/report.md
labels: link-checker