Skip to content

Commit 9169fb9

Browse files
Updated catching new md files
1 parent f28ccf3 commit 9169fb9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/lychee-links.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- name: Checkout PR code
11+
- name: Checkout code
1212
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0 # important to allow full diff
1315

1416
- name: Get changed Markdown files
1517
id: changed-files
1618
run: |
17-
echo "Fetching changed markdown files..."
18-
files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '\.md$' || true)
19-
echo "Changed Markdown files: $files"
19+
git fetch origin main
20+
files=$(git diff --name-only origin/main...HEAD | grep '\.md$' || true)
2021
echo "md_files<<EOF" >> $GITHUB_OUTPUT
2122
echo "$files" >> $GITHUB_OUTPUT
2223
echo "EOF" >> $GITHUB_OUTPUT
2324
24-
- name: Run Lychee only on internal links in changed .md files
25+
- name: Run Lychee on changed Markdown files (internal links only)
2526
if: steps.changed-files.outputs.md_files != ''
2627
uses: lycheeverse/[email protected]
2728
with:

0 commit comments

Comments
 (0)