Skip to content

Commit

Permalink
github: add action to check for broken links in Markdown, HTML
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Login <batazor111@gmail.com>
  • Loading branch information
batazor committed Mar 19, 2023
1 parent f18e4e7 commit cc579c1
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Links

on:
repository_dispatch:
workflow_dispatch:
schedule:
# At 09:00 on Monday: https://crontab.guru/#0_9_*_*_1
- cron: '0 9 * * 1'

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Restore lychee cache
uses: actions/cache@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@d322e38893906cef8788eefe9c63694c562c7dfa # for v1.6.1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
args: "--cache --max-cache-age 1d"

- name: Save lychee cache
uses: actions/cache/save@v3
if: always()
with:
path: .lycheecache
key: ${{ steps.restore-cache.outputs.cache-primary-key }}

- name: Create Issue From File
if: env.lychee_exit_code != 0
uses: peter-evans/create-issue-from-file@v4
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue

0 comments on commit cc579c1

Please sign in to comment.