Scope dead-link checks to changed documentation
Changed branch builds from a repository-wide dead-link scan to merge-base-aware checks of added or modified Markdown, while retaining full scans for nightly and upstream development runs.
apache/seatunnel · #12469
CI efficiency improvement
Pull-request builds check only changed Markdown while nightly and upstream development runs retain the full documentation scan, reducing unrelated link noise and runner time.
Problem
Every push checked roughly 1,090 Markdown files for six to eight minutes, so unrelated pull requests routinely reported advisory failures when an untouched external link returned a transient error. Bash error handling also stopped the old loop at the first failed file.
Approach
Selects changed Markdown safely from the merge base, skips deleted files, retries each failing file once, reports every remaining failure, and falls back to the full scan when the base cannot be resolved. Full scheduled and upstream scans remain unchanged.
Impact and scope
- Removes most unrelated dead-link noise from pull requests while preserving repository-wide link-rot detection in nightly and upstream development runs.
- Avoids installing the checker when a branch changes no Markdown and saves roughly six runner-minutes on those pushes.
- Handles spaces, option-like filenames, Unicode paths, multiple failures, and deleted files without truncating the scan.
- A rename or deletion can still break links from unchanged documents; the nightly full scan remains responsible for that cross-file case.
Validation
- Actionlint, YAML parsing, and bash syntax checks passed for the workflow.
- Scratch-repository scenarios covered changed files, no-Markdown branches, deleted files, full scans, fetch fallback, retries, Unicode, and option-like filenames.
- The scheduled and upstream full-scan paths could not be exercised on GitHub before merge.
- All four hosted checks passed and two upstream contributors approved the authored change.