Check Markdown links #789
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 Markdown links | |
| # Explicit least-privilege permissions for link checking | |
| permissions: | |
| contents: read | |
| issues: write # Required to create issues for broken links (if configured) | |
| on: | |
| repository_dispatch: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "00 18 * * *" | |
| jobs: | |
| linkChecker: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 | |
| - name: Restore lychee cache | |
| id: restore-cache | |
| uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 | |
| with: | |
| path: .lycheecache | |
| key: cache-lychee-${{ github.sha }} | |
| restore-keys: cache-lychee- | |
| - name: Link Checker | |
| uses: lycheeverse/lychee-action@f613c4a64e50d792e0b31ec34bbcbba12263c6a6 | |
| with: | |
| args: > | |
| --cache | |
| --max-cache-age 1d | |
| --max-redirects 10 | |
| --max-retries 5 | |
| --timeout 10 | |
| --user-agent "Mozilla/5.0 (compatible; LinkChecker/1.0)" | |
| --exclude-path ./node_modules | |
| --exclude-path ./dist | |
| --exclude-path ./.astro | |
| . | |
| fail: true | |
| - name: Save lychee cache | |
| uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 | |
| if: always() | |
| with: | |
| path: .lycheecache | |
| key: ${{ steps.restore-cache.outputs.cache-primary-key }} | |
| - name: Create Issue | |
| if: env.lychee_exit_code != 0 | |
| uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd | |
| with: | |
| title: π Broken Links Detected - ${{ github.run_number }} | |
| content-filepath: ./lychee/out.md | |
| labels: | | |
| bug | |
| automated | |
| links |