Broken Link Checker #7
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 | |
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: Create markdown file | |
run: | | |
echo "${{ steps.lychee.outputs.report }}" > broken_links_report.md | |
- name: Commit changes | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add broken_links_report.md | |
git commit -m "Add broken links report" || 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: 'Add broken links report' | |
title: 'Broken links report' | |
body: 'This PR adds a broken links report. See `broken_links_report.md` for details.' | |
branch: 'broken-links-report' |