Skip to content

Commit 4c9e97d

Browse files
committed
workflow
1 parent b574a5b commit 4c9e97d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/reusable-link-check.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,27 @@ jobs:
3232
echo "files=$modified_files" >> $GITHUB_OUTPUT
3333
echo "Modified files: $modified_files"
3434
35+
- name: Check if lychee config was modified
36+
if: github.event_name == 'pull_request'
37+
id: config-check
38+
run: |
39+
merge_base=$(git merge-base origin/${{ github.base_ref }} HEAD)
40+
config_modified=$(git diff --name-only $merge_base...${{ github.event.pull_request.head.sha }} \
41+
| grep -E '\.github/scripts/lychee-config\.toml$' || true)
42+
if [ -n "$config_modified" ]; then
43+
echo "modified=true" >> $GITHUB_OUTPUT
44+
else
45+
echo "modified=false" >> $GITHUB_OUTPUT
46+
fi
47+
3548
- name: Link check - all links (modified files only)
3649
if: github.event_name == 'pull_request' && steps.modified-files.outputs.files != ''
3750
env:
3851
GITHUB_TOKEN: ${{ github.token }}
3952
run: ./.github/scripts/link-check.sh ${{ steps.modified-files.outputs.files }}
4053

4154
- name: Link check - all links (all files)
42-
if: github.event_name != 'pull_request'
55+
if: github.event_name != 'pull_request' || steps.config-check.outputs.modified == 'true'
4356
env:
4457
GITHUB_TOKEN: ${{ github.token }}
4558
run: ./.github/scripts/link-check.sh

0 commit comments

Comments
 (0)