Skip to content

Still Waters Run Shallow

Choose a tag to compare

@pento pento released this 16 Mar 01:51
· 7 commits to main since this release
cd81181

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 with git fetch --depth=1. No workflow changes needed.
  • Two-ref diff syntax: Switched from A...B (merge-base) to A B (direct tree comparison), which only needs the two commits to be present.
  • Warnings on failure: If git diff still fails (e.g., no remote access), a ::warning:: annotation is emitted instead of silently returning zero files. (#6)