name: Markdown Link Check on: schedule: - cron: "0 0 * * 2" # Every Tuesday at 00:00 UTC push: branches: - dev paths: - ".github/workflows/markdown-checker.yml" - "docs/**" - "**/*.md" pull_request: branches: - dev paths: - ".github/workflows/markdown-checker.yml" - "docs/**" - "**/*.md" workflow_dispatch: jobs: check-links: name: Check Dead Links if: github.repository_owner == 'MaaAssistantArknights' && github.event.head_commit.author.email != '41898282+github-actions[bot]@users.noreply.github.com' runs-on: ubuntu-latest permissions: pull-requests: write env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout repository uses: actions/checkout@v6 with: show-progress: false - name: Cache lychee responses uses: actions/cache@v5 continue-on-error: true with: path: .lycheecache key: lychee-cache - name: Check dead internal 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' -- './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 }}