Skip to content

Check for broken links on site #33

Check for broken links on site

Check for broken links on site #33

name: Check for broken links
on:
workflow_run:
workflows: [Deploy site]
types: [completed]
workflow_dispatch: # Allow manual triggering
jobs:
check-links:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"
bundler-cache: true
- name: Build site
run: |
bundle install
bundle exec jekyll build
env:
JEKYLL_ENV: production
- name: Run Lychee Link Checker
uses: lycheeverse/lychee-action@v1.9.0
with:
args: >-
--verbose
--no-progress
--exclude-path '.*\{\{.*\}\}.*'
--exclude-all-private
--accept 200,204,206,401,403,405,410,451,999
--timeout 30
--max-retries 5
--no-fragment
--insecure
--user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
'./_site/**/*.html'
fail: true
format: markdown
jobSummary: true
output: lychee/out.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create issue on failure
if: failure()
uses: peter-evans/create-issue-from-file@v4
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue