link checker #1614
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: link checker | |
on: | |
repository_dispatch: | |
# Run action manually when needed | |
workflow_dispatch: | |
# Check links once a week on Monday | |
schedule: | |
- cron: "00 00 * * 1" | |
# Runs on each PR for the master branch | |
pull_request: | |
branches: | |
- "master" | |
jobs: | |
Checking-Links: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks out a copy of your repository on the ubuntu-latest machine | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# fetch external files && Building the docs | |
- name: Build the docs | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- run: npm run deploy-docs | |
# Enable Lychee cache | |
- name: Restore lychee cache | |
uses: actions/cache@v3 | |
with: | |
path: .lycheecache | |
key: cache-lychee-${{ github.sha }} | |
restore-keys: cache-lychee- | |
# Run link checker on the generated HTML | |
- name: Link Checker | |
id: lychee | |
uses: lycheeverse/lychee-action@ec7614d7605b47efb08dc370f6d0a71884cba944 # 1.8.0 | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
args: > | |
--config ./lychee.toml | |
"build/**/*" "tools/fetch-external.sh" | |
- name: Create Issue From File | |
if: | | |
github.event_name != 'pull_request' && | |
env.lychee_exit_code != 0 | |
uses: peter-evans/create-issue-from-file@v4 | |
with: | |
title: Link Checker Report | |
content-filepath: ./lychee/out.md | |
labels: good-first-issue, automated issue |