Broken links checks #566
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 links checks | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 0" # Every sunday at midnight | |
pull_request: | |
branches: ["main"] | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate Token | |
id: generate-token | |
uses: tibdex/[email protected] | |
with: | |
app_id: "${{ secrets.BOT_APP_ID }}" | |
private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Restore lychee cache | |
uses: actions/cache@v4 | |
with: | |
path: .lycheecache | |
key: cache-lychee-${{ github.sha }} | |
restore-keys: cache-lychee- | |
- name: Scan for broken links | |
uses: lycheeverse/lychee-action@v1 | |
id: lychee | |
env: | |
GITHUB_TOKEN: "${{ steps.generate-token.outputs.token }}" | |
with: | |
args: > | |
--cache | |
--max-cache-age 1d | |
--verbose | |
--exclude-mail | |
'./**/*.md' './**/*.tf' | |
- name: Find Broken links issues | |
id: broken-link-check-issue | |
uses: micalevisk/last-issue-action@v2 | |
with: | |
state: open | |
labels: | | |
broken-links | |
- name: Update issues | |
uses: peter-evans/create-issue-from-file@v5 | |
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 |