Create Issue From File #24
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 markdown links | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' # Every month | |
push: | |
branches: | |
- main | |
paths: | |
- 'content/**' | |
- '.lycheeignore' | |
- '.github/workflows/lychee.yml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
linkcheck: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write # required for peter-evans/create-issue-from-file | |
env: | |
DIR: 'content' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Restore lychee cache | |
id: restore-cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: .lycheecache | |
key: cache-lychee-${{ github.sha }} | |
restore-keys: cache-lychee- | |
- name: Lychee Checker | |
uses: lycheeverse/[email protected] | |
id: lychee | |
with: | |
fail: false | |
args: '--accept 200,204,429 --verbose --no-progress --cache --max-cache-age 1d ${{ env.DIR }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Save lychee cache | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: .lycheecache | |
key: ${{ steps.restore-cache.outputs.cache-primary-key }} | |
- name: Create Issue From File | |
if: env.exit_code != 0 | |
uses: peter-evans/create-issue-from-file@v5 | |
with: | |
title: Link Checker Report | |
content-filepath: ./lychee/out.md | |
labels: 'automated issue' |