Skip to content

Broken Link Checker

Broken Link Checker #9

name: Broken Link Checker
on:
repository_dispatch:
types: [test]
workflow_dispatch:
schedule:
- cron: '00 18 * * *'
jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check Links
id: lychee
uses: lycheeverse/lychee-action@v1.10.0
with:
args: --verbose --no-progress './**/*.md' './**/*.html' './**/*.json' --exclude-mail --exclude 'http://localhost:*/*' --exclude 'https://*.canva.com/*'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Fix broken links" -a || echo "No changes to commit"
shell: bash
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Fix broken links'
title: 'Fix broken links'
body: 'This PR fixes broken links found by the link checker.'
branch: 'fix/broken-links'