2024-09-02 21:03:47 +00:00
|
|
|
name: docs
|
2023-09-19 20:22:20 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- "docs/**"
|
|
|
|
- "*.md"
|
|
|
|
branches:
|
|
|
|
- main
|
2024-06-19 17:16:04 +00:00
|
|
|
- 3.x
|
2023-09-19 20:22:20 +00:00
|
|
|
|
|
|
|
# Remove default permissions of GITHUB_TOKEN for security
|
|
|
|
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
|
|
|
|
permissions: {}
|
|
|
|
|
|
|
|
jobs:
|
2023-09-21 07:50:20 +00:00
|
|
|
link-checker:
|
2023-09-19 20:22:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
# Cache lychee results (e.g. to avoid hitting rate limits)
|
|
|
|
- name: Restore lychee cache
|
2024-12-09 16:56:54 +00:00
|
|
|
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
2023-09-19 20:22:20 +00:00
|
|
|
with:
|
|
|
|
path: .lycheecache
|
|
|
|
key: cache-lychee-${{ github.sha }}
|
|
|
|
restore-keys: cache-lychee-
|
|
|
|
|
|
|
|
# check links with Lychee
|
2024-10-23 19:15:49 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2023-09-19 20:22:20 +00:00
|
|
|
|
|
|
|
- name: Lychee link checker
|
2024-11-19 18:59:20 +00:00
|
|
|
uses: lycheeverse/lychee-action@4aa18b6ccdac05029fab067313a6a04f941e6494 # for v1.8.0
|
2023-09-19 20:22:20 +00:00
|
|
|
with:
|
|
|
|
# arguments with file types to check
|
|
|
|
args: >-
|
2024-12-11 13:58:56 +00:00
|
|
|
'-c=lychee.toml'
|
|
|
|
'./docs/**/*.md'
|
|
|
|
'./docs/**/*.html'
|
|
|
|
'./packages/*/src/**/*.ts'
|
|
|
|
'./packages/*/src/**/*.js'
|
|
|
|
'./packages/*/src/**/*.md'
|
2023-09-19 20:22:20 +00:00
|
|
|
# fail the action on broken links
|
|
|
|
fail: true
|
|
|
|
env:
|
|
|
|
# to be used in case rate limits are surpassed
|
2024-12-11 13:58:56 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|