|
1 | | -name: Markdown Broken Links Checker |
| 1 | +name: Markdown Link Checker |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | pull_request: |
5 | 5 | paths: |
6 | 6 | - '**/*.md' |
7 | | - workflow_dispatch: # Manual trigger for full repo check |
| 7 | + workflow_dispatch: |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - validate-markdown-links-pr: |
11 | | - name: Check Broken Links in PR |
12 | | - if: github.event_name == 'pull_request' |
| 10 | + markdown-link-check: |
| 11 | + name: Check Markdown Links |
13 | 12 | runs-on: ubuntu-latest |
14 | 13 |
|
15 | 14 | steps: |
16 | | - - name: Checkout Repository |
| 15 | + - name: Checkout Repo |
17 | 16 | uses: actions/checkout@v4 |
18 | 17 | with: |
19 | 18 | fetch-depth: 0 |
20 | 19 |
|
21 | | - - name: Get changed Markdown files |
| 20 | + - name: Get Changed Markdown Files (PR only) |
22 | 21 | id: changed-files |
| 22 | + if: github.event_name == 'pull_request' |
23 | 23 | run: | |
24 | 24 | git fetch origin ${{ github.base_ref }} |
25 | 25 | files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep '\.md$' || true) |
26 | 26 | echo "md_files<<EOF" >> $GITHUB_OUTPUT |
27 | 27 | echo "$files" >> $GITHUB_OUTPUT |
28 | 28 | echo "EOF" >> $GITHUB_OUTPUT |
29 | 29 |
|
30 | | - - name: Run Lychee on changed Markdown files (internal links only) |
31 | | - if: steps.changed-files.outputs.md_files != '' |
| 30 | + - name: Run Lychee on Changed Files (PR) |
| 31 | + if: github.event_name == 'pull_request' && steps.changed-files.outputs.md_files != '' |
32 | 32 | uses: lycheeverse/[email protected] |
33 | 33 | with: |
34 | 34 | args: > |
35 | | - --verbose |
36 | | - --exclude-mail |
37 | | - --no-progress |
38 | | - --exclude ^https?:// |
| 35 | + --verbose --exclude-mail --no-progress --exclude ^https?:// |
39 | 36 | ${{ steps.changed-files.outputs.md_files }} |
40 | 37 | env: |
41 | 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
42 | 39 |
|
43 | | - validate-markdown-links-fullRepo: |
44 | | - name: Check Broken Links in Full Repo (Manual) |
45 | | - if: github.event_name == 'workflow_dispatch' |
46 | | - runs-on: ubuntu-latest |
47 | | - |
48 | | - steps: |
49 | | - - name: Checkout Repository |
50 | | - uses: actions/checkout@v4 |
51 | | - |
52 | | - - name: Run Lychee on All Markdown Files (internal links only) |
| 40 | + - name: Run Lychee on All Files (Manual) |
| 41 | + if: github.event_name == 'workflow_dispatch' |
53 | 42 | uses: lycheeverse/[email protected] |
54 | 43 | with: |
55 | 44 | args: > |
56 | | - --verbose |
57 | | - --exclude-mail |
58 | | - --no-progress |
59 | | - --exclude ^https?:// |
| 45 | + --verbose --exclude-mail --no-progress --exclude ^https?:// |
60 | 46 | '**/*.md' |
61 | 47 | output: lychee/out.md |
62 | 48 | env: |
|
0 commit comments