@@ -20,40 +20,16 @@ jobs:
2020 if : github.event_name == 'pull_request'
2121 env :
2222 GITHUB_TOKEN : ${{ github.token }}
23- run : mise run lint-local-links
24-
25- - name : Get modified files
26- if : github.event_name == 'pull_request'
27- id : modified-files
28- run : |
29- merge_base=$(git merge-base origin/${{ github.base_ref }} HEAD)
30- # Using lychee's default extension filter here to match when it runs against all files
31- # Note: --diff-filter=d filters out deleted files
32- modified_files=$(git diff --name-only --diff-filter=d $merge_base...${{ github.event.pull_request.head.sha }} \
33- | grep -E '\.(md|mkd|mdx|mdown|mdwn|mkdn|mkdown|markdown|html|htm|txt)$' \
34- | tr '\n' ' ' || true)
35- echo "files=$modified_files" >> $GITHUB_OUTPUT
36- echo "Modified files: $modified_files"
37-
38- - name : Check if lychee config was modified
39- if : github.event_name == 'pull_request'
40- id : config-check
41- run : |
42- merge_base=$(git merge-base origin/${{ github.base_ref }} HEAD)
43- config_modified=$(git diff --name-only $merge_base...${{ github.event.pull_request.head.sha }} \
44- | grep -E '^(\.github/config/lychee\.toml|mise\.toml)$' || true)
45- if [ -n "$config_modified" ]; then
46- echo "modified=true" >> $GITHUB_OUTPUT
47- fi
23+ run : mise run lint:local-links
4824
4925 - name : Link check (modified files only)
50- if : github.event_name == 'pull_request' && steps.modified-files.outputs.files != '' && steps.config-check.outputs.modified != 'true'
26+ if : github.event_name == 'pull_request'
5127 env :
5228 GITHUB_TOKEN : ${{ github.token }}
53- run : mise run lint- links ${{ steps.modified-files.outputs.files }}
29+ run : mise run lint: links-in-modified-file --base origin/ ${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }}
5430
5531 - name : Link check (all files)
56- if : github.event_name != 'pull_request' || steps.config-check.outputs.modified == 'true'
32+ if : github.event_name != 'pull_request'
5733 env :
5834 GITHUB_TOKEN : ${{ github.token }}
59- run : mise run lint- links
35+ run : mise run lint: links-if-config-changed
0 commit comments