Broken Link Checker #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
uses: lycheeverse/lychee-action@v1.10.0 | |
with: | |
args: --verbose --no-progress './**/*.md' './**/*.html' './**/*.json' --exclude-mail --exclude 'http://localhost:*/*' | |
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' |