Skip to content

Commit 2d22d35

Browse files
Update Broken-links-checker-final.yml
1 parent bff9574 commit 2d22d35

File tree

1 file changed

+13
-27
lines changed

1 file changed

+13
-27
lines changed

.github/workflows/Broken-links-checker-final.yml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,48 @@
1-
name: Markdown Broken Links Checker
1+
name: Markdown Link Checker
22

33
on:
44
pull_request:
55
paths:
66
- '**/*.md'
7-
workflow_dispatch: # Manual trigger for full repo check
7+
workflow_dispatch:
88

99
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
1312
runs-on: ubuntu-latest
1413

1514
steps:
16-
- name: Checkout Repository
15+
- name: Checkout Repo
1716
uses: actions/checkout@v4
1817
with:
1918
fetch-depth: 0
2019

21-
- name: Get changed Markdown files
20+
- name: Get Changed Markdown Files (PR only)
2221
id: changed-files
22+
if: github.event_name == 'pull_request'
2323
run: |
2424
git fetch origin ${{ github.base_ref }}
2525
files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep '\.md$' || true)
2626
echo "md_files<<EOF" >> $GITHUB_OUTPUT
2727
echo "$files" >> $GITHUB_OUTPUT
2828
echo "EOF" >> $GITHUB_OUTPUT
2929
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 != ''
3232
uses: lycheeverse/[email protected]
3333
with:
3434
args: >
35-
--verbose
36-
--exclude-mail
37-
--no-progress
38-
--exclude ^https?://
35+
--verbose --exclude-mail --no-progress --exclude ^https?://
3936
${{ steps.changed-files.outputs.md_files }}
4037
env:
4138
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4239

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'
5342
uses: lycheeverse/[email protected]
5443
with:
5544
args: >
56-
--verbose
57-
--exclude-mail
58-
--no-progress
59-
--exclude ^https?://
45+
--verbose --exclude-mail --no-progress --exclude ^https?://
6046
'**/*.md'
6147
output: lychee/out.md
6248
env:

0 commit comments

Comments
 (0)