Skip to content

[course] 日常

[course] 日常 #172

Workflow file for this run

name: check
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- uses: lycheeverse/lychee-action@v2
id: lychee
with:
# Fail on pull request, but create an issue otherwise
fail: ${{ github.event_name == 'pull_request' }}
args: >-
--verbose
--no-progress
--config .github/config/lychee.toml
.
- name: Find last link-checker issue
id: link-checker-issue
uses: micalevisk/last-issue-action@v2
with:
state: open
labels: |
link-checker
- name: Create or update issue
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
# Update an existing issue if one was found (issue-number),
# otherwise an empty value creates a new issue:
issue-number: "${{ steps.link-checker-issue.outputs.issue-number }}"
content-filepath: ./lychee/out.md
labels: automated issue, link-checker