Nuxt/.github/workflows/docs-check-links.yml

47 lines
1.3 KiB
YAML
Raw Normal View History

name: docs
2023-09-19 20:22:20 +00:00
on:
pull_request:
paths:
- "docs/**"
- "*.md"
branches:
- main
- 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:
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
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.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
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
2023-09-19 20:22:20 +00:00
- name: Lychee link checker
uses: lycheeverse/lychee-action@7da8ec1fc4e01b5a12062ac6c589c10a4ce70d67 # for v1.8.0
2023-09-19 20:22:20 +00:00
with:
# arguments with file types to check
args: >-
--cache
--verbose
--no-progress
--max-cache-age=1d
'./**/*.md'
'./**/*.html'
# fail the action on broken links
fail: true
env:
# to be used in case rate limits are surpassed
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}