Previous fix removed --depth 1 entirely when $Commit was set, causing full clones on every workflow run (github.sha is always non-empty). Better approach: keep --depth 1 (fast path), detect checkout failure, then fetch --unshallow and retry. Only pays full-clone cost when the requested commit is actually older than HEAD.