Still Waters Run Shallow
Fix: New/modified file detection in shallow clones
actions/checkout defaults to fetch-depth: 1, which means only the merge commit is available locally. The action's git diff calls used three-dot syntax (A...B), which requires merge-base computation and connected history between commits — neither of which exist in a shallow clone. The error was silently swallowed, causing the action to report "No new files detected" and "No modified files detected" even when the PR had changed files.
Three changes:
- Auto-fetch refs: Before running
git diff, the action now fetches the base and head refs withgit fetch --depth=1. No workflow changes needed. - Two-ref diff syntax: Switched from
A...B(merge-base) toA B(direct tree comparison), which only needs the two commits to be present. - Warnings on failure: If
git diffstill fails (e.g., no remote access), a::warning::annotation is emitted instead of silently returning zero files. (#6)