Link Check #36
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: "Link Check" | |
on: # yamllint disable-line rule:truthy | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 0" # 0:00 every sunday | |
jobs: | |
link-check: | |
name: Link Check | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write # required for peter-evans/create-issue-from-file | |
steps: | |
- name: Generate Token | |
uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: "${{ secrets.BOT_APP_ID }}" | |
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: "${{ steps.app-token.outputs.token }}" | |
fetch-depth: 0 | |
- name: Link Checker | |
uses: lycheeverse/lychee-action@v2 | |
with: | |
# Check all markdown files in repo (default) | |
args: --base . --verbose --no-progress './**/*.md' | |
format: markdown | |
output: results.md | |
# Don't fail action on broken links | |
fail: false | |
- name: Print Output | |
run: cat results.md | |
- name: Find Link Checker Issue | |
id: link-checker-issue | |
uses: micalevisk/last-issue-action@v2 | |
with: | |
state: open | |
labels: | | |
link-checker | |
- name: Create or Update Issue | |
uses: peter-evans/create-issue-from-file@v5 | |
with: | |
title: Broken links detected 🔗 | |
issue-number: ${{ steps.link-checker-issue.outputs.has-found == 'true' && steps.link-checker-issue.outputs.issue-number || '' }} | |
content-filepath: results.md | |
labels: | | |
link-checker |