oxc/.github/workflows/link-check.yml
Devin-Yeung fe2d8448a7
chore(ci): check links in CI (#803)
As mentioned in
https://github.com/web-infra-dev/oxc/pull/800#discussion_r1306616508, we
better check the validity of links in CI

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-08-28 11:46:56 +08:00

40 lines
1.2 KiB
YAML

name: Check Links
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '**/*.md'
- '**/*.html'
pull_request:
types: [opened, synchronize]
paths:
- '**/*.md'
- '**/*.html'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
check-links:
name: Check Links
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check Links
uses: lycheeverse/lychee-action@master
with:
# For parameter description, see https://github.com/lycheeverse/lychee#commandline-parameters
# Accept 429 for now due to GitHub rate limit.
# See https://github.com/lycheeverse/lychee/issues/634
# Exclude twitter links, see https://github.com/lycheeverse/lychee/issues/1108.
# Ideally this is built in, by https://github.com/lycheeverse/lychee/pull/1147.
# Not sure why it doesn't work, exclude it manually.
args: --accept 200,429 --verbose --no-progress --exclude 'https://twitter\.com/*' .
# Fail action on broken links
fail: true