ci: links check during pr and everyday

Signed-off-by: Bird <aflybird0@gmail.com>
This commit is contained in:
Bird
2023-07-20 11:00:38 +08:00
parent 3133236ba9
commit eea4e63db4
5 changed files with 99 additions and 9 deletions

40
.github/workflows/link-pr.yaml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: links when pr
on:
pull_request:
branches: [ master ]
paths:
- '**.md'
- '.lycheeignore'
jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: install doc dependencies
run: sudo npm i
- name: build
run: |
npm run docs:build
- name: Link Checker
uses: lycheeverse/lychee-action@v1.8.0
with:
fail: true
# For parameter description, see https://github.com/lycheeverse/lychee#commandline-parameters
# -E, --exclude-all-private Exclude all private IPs from checking.
# -i, --insecure Proceed for server connections considered insecure (invalid TLS)
# -n, --no-progress Do not show progress bar.
# -t, --timeout <timeout> Website timeout in seconds from connect to response finished [default:20]
# --max-concurrency <max-concurrency> Maximum number of concurrent network requests [default: 128]
# -a --accept <accept> Comma-separated list of accepted status codes for valid links
# .vitepress/dist the site directory to check
# *.md all markdown files in the root directory
args: -E -i -n -t 45 --max-concurrency 64 -a 401,403 -- '.vitepress/dist' '*.md'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}