-
Notifications
You must be signed in to change notification settings - Fork 67
69 lines (56 loc) · 2.05 KB
/
Copy pathlink-checker.yml
File metadata and controls
69 lines (56 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Link Checker
on:
pull_request:
branches:
- main
- km-updates
paths:
- '**.md'
- 'docs/**'
- 'training-data/**/*.json'
workflow_dispatch: # Allow manual triggering
concurrency:
group: link-checker-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
permissions:
pull-requests: write
jobs:
link-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Check links in markdown files
uses: lycheeverse/lychee-action@v2
with:
# Use the lychee.toml config file for all settings
# Just check current directory recursively - lychee finds markdown files automatically
args: --config .github/lychee.toml --verbose --no-progress .
# Don't fail the PR - just report broken links (optional check)
fail: false
- name: Find existing comment
if: always()
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '🔗 Link Check Results'
- name: Create or Update Comment on PR
if: always()
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: |
## 🔗 Link Check Results
The link checker has completed. This is an **optional check** and will not block the PR.
[View workflow run for details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
If broken links were found, please review them at your convenience.
---
*Last updated: Run #${{ github.run_number }} at ${{ github.event.repository.updated_at }}*