Files
MaaAssistantArknights/.github/workflows/markdown-checker.yml
Loong 260ab6e839 ci: don't check github link (#12667)
* ci: don't check github link

* ci: remove cache

* chore: readd cache

---------

Co-authored-by: Constrat <56174894+Constrat@users.noreply.github.com>
2025-05-13 16:39:44 +02:00

65 lines
1.9 KiB
YAML

name: Check Dead Links
on:
schedule:
- cron: "0 0 * * 2" # Every Tuesday at 00:00 UTC
push:
branches:
- dev
paths:
- "**/*.md"
- "docs/**"
- ".github/workflows/markdown-checker.yml"
pull_request:
branches:
- dev
paths:
- "**/*.md"
- "docs/**"
- ".github/workflows/markdown-checker.yml"
workflow_dispatch:
jobs:
check-links:
if: github.repository_owner == 'MaaAssistantArknights' && github.event.head_commit.author.email != '41898282+github-actions[bot]@users.noreply.github.com'
name: Check Dead Links
runs-on: ubuntu-latest
permissions:
pull-requests: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
show-progress: false
- name: Cache Primes
id: cache-primes
uses: actions/cache@v4
with:
path: .lycheecache
key: lychee-cache
- name: Check dead links
uses: lycheeverse/lychee-action@v2
with:
# 仅检查内部链接,排除所有外部链接
args: >
--verbose --no-progress
--cache --max-cache-age 1d --cache-exclude-status '429, 500..599'
--exclude 'https?://.*'
--exclude-path 'docs/zh-tw/manual/introduction/introduction_old.md'
--exclude-path 'docs/ja-jp/manual/introduction/introduction_old.md'
--exclude 'files/MAA_Runtime_Fix_Pwsh.ps1$'
-- './docs/**/*.md' './README.md'
- name: Comment (only for PR)
if: failure() && github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
Dead links found in the documentation. Please fix them.
Details: https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/${{ github.run_id }}