check links #803
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: check links | |
on: | |
repository_dispatch: {} | |
workflow_dispatch: {} | |
schedule: | |
- cron: "00 18 * * *" | |
permissions: read-all | |
jobs: | |
check-links: | |
runs-on: ubuntu-24.04 | |
permissions: | |
issues: write | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Restore lychee cache | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 | |
with: | |
path: .lycheecache | |
key: cache-lychee-${{ github.sha }} | |
restore-keys: cache-lychee- | |
- name: Link Checker | |
id: lychee | |
uses: lycheeverse/lychee-action@f81112d0d2814ded911bd23e3beaa9dda9093915 # v2.1.0 | |
with: | |
args: "--cache --max-cache-age 3d ." | |
env: | |
GITHUB_TOKEN: ${{secrets.github-token}} | |
- name: Look for an existing issue | |
id: last-issue | |
uses: micalevisk/last-issue-action@0d40124cc99ac8601c2516007f0c98ef3d27537b # v2.3.0 | |
with: | |
state: open | |
labels: lychee link check | |
- name: Create Issue From File | |
if: ${{ steps.lychee.outputs.exit_code != 0 }} | |
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5.0.1 | |
with: | |
title: Link Checker Report | |
content-filepath: ./lychee/out.md | |
issue-number: ${{ steps.last-issue.outputs.issue-number }} | |
labels: lychee link check |