diff --git a/.github/workflows/reusable-link-check.yml b/.github/workflows/reusable-link-check.yml
index e891e6d06..87711b6ce 100644
--- a/.github/workflows/reusable-link-check.yml
+++ b/.github/workflows/reusable-link-check.yml
@@ -20,40 +20,9 @@ jobs:
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ github.token }}
- run: mise run lint-local-links
-
- - name: Get modified files
- if: github.event_name == 'pull_request'
- id: modified-files
- run: |
- merge_base=$(git merge-base origin/${{ github.base_ref }} HEAD)
- # Using lychee's default extension filter here to match when it runs against all files
- # Note: --diff-filter=d filters out deleted files
- modified_files=$(git diff --name-only --diff-filter=d $merge_base...${{ github.event.pull_request.head.sha }} \
- | grep -E '\.(md|mkd|mdx|mdown|mdwn|mkdn|mkdown|markdown|html|htm|txt)$' \
- | tr '\n' ' ' || true)
- echo "files=$modified_files" >> $GITHUB_OUTPUT
- echo "Modified files: $modified_files"
-
- - name: Check if lychee config was modified
- if: github.event_name == 'pull_request'
- id: config-check
- run: |
- merge_base=$(git merge-base origin/${{ github.base_ref }} HEAD)
- config_modified=$(git diff --name-only $merge_base...${{ github.event.pull_request.head.sha }} \
- | grep -E '^(\.github/config/lychee\.toml|mise\.toml)$' || true)
- if [ -n "$config_modified" ]; then
- echo "modified=true" >> $GITHUB_OUTPUT
- fi
+ run: mise run lint:local-links
- name: Link check (modified files only)
- if: github.event_name == 'pull_request' && steps.modified-files.outputs.files != '' && steps.config-check.outputs.modified != 'true'
- env:
- GITHUB_TOKEN: ${{ github.token }}
- run: mise run lint-links ${{ steps.modified-files.outputs.files }}
-
- - name: Link check (all files)
- if: github.event_name != 'pull_request' || steps.config-check.outputs.modified == 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
- run: mise run lint-links
+ run: mise run lint:links-in-modified-files --base origin/${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }} --event ${{ github.event_name }}
diff --git a/.mise/tasks/lint/.shellcheckrc b/.mise/tasks/lint/.shellcheckrc
new file mode 100644
index 000000000..c186fb835
--- /dev/null
+++ b/.mise/tasks/lint/.shellcheckrc
@@ -0,0 +1,3 @@
+# shellcheck configuration for mise tasks
+# SC2154: usage_* variables are set by mise framework
+disable=SC2154
diff --git a/.mise/tasks/lint/links-in-modified-files.sh b/.mise/tasks/lint/links-in-modified-files.sh
new file mode 100755
index 000000000..893723a44
--- /dev/null
+++ b/.mise/tasks/lint/links-in-modified-files.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+#MISE description="Lint links in modified files"
+
+set -e
+
+#USAGE flag "--base