ci: Add script &CI to check dead links #37
Workflow file for this run
This file contains hidden or 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: Check Broken Links | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
# Optional: Add scheduled checks | |
# schedule: | |
# - cron: "0 0 * * 0" # Runs once every Sunday | |
jobs: | |
check-links: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup link exclusion patterns (optional) | |
id: setup-exclude | |
run: | | |
if [ -f .lycheeignore ]; then | |
echo "Exclusion patterns found in .lycheeignore" | |
else | |
echo "# Add URL regex patterns to exclude, one per line" > .lycheeignore | |
echo "# Example: ^https://example.com" >> .lycheeignore | |
fi | |
- name: Link Checker | |
id: lychee | |
uses: lycheeverse/lychee-action@v2 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
args: --verbose --no-progress './**/*.md' './**/*.html' './**/*.txt' | |
fail: true | |
format: markdown | |
output: ./lychee-report.md | |
# If you want to post check results as PR comments, uncomment the following step | |
# - name: Create Comment | |
# uses: peter-evans/create-or-update-comment@v3 | |
# if: github.event_name == 'pull_request' && steps.lychee.outputs.exit_code != 0 | |
# with: | |
# issue-number: ${{ github.event.pull_request.number }} | |
# body-file: ./lychee-report.md |