Skip to content

Broken Link Check

Broken Link Check #12

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/softprops/github-actions-schemas/master/workflow.json
name: "Broken Link Check"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
id: generate-token
with:
app_id: "${{ secrets.BOT_APP_ID }}"
private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
token: "${{ steps.generate-token.outputs.token }}"
- name: Scan for broken links
uses: lycheeverse/lychee-action@97189f2c0a3c8b0cb0e704fd4e878af6e5e2b2c5 # v1.7.0
id: lychee
env:
GITHUB_TOKEN: "${{ steps.generate-token.outputs.token }}"
with:
args: --verbose --no-progress --exclude-mail './**/*.md'
- name: Find Link Checker Issue
id: broken-link-check-issue
uses: micalevisk/last-issue-action@305829d9728f47beb0029417167a0af890edfd6e # v2.1.0
with:
state: open
labels: |
broken-links
- name: Update Issue
uses: peter-evans/create-issue-from-file@433e51abf769039ee20ba1293a088ca19d573b7f # renovate: tag=v4.0.1
with:
title: Broken links detected 🔗
issue-number: "${{ steps.broken-link-check-issue.outputs.issue-number }}"
content-filepath: ./lychee/out.md
token: "${{ steps.generate-token.outputs.token }}"
labels: |
broken-links