fix(crow): probe the auto-patch branch with git ls-remote to avoid a scary fatal

The no-op path worked (the else branch runs and exits 0), but using `git fetch`
as the existence check printed `fatal: couldn't find remote ref ...` to stderr
when the branch is absent -- which reads as a failure even though the step
succeeds. Probe with `git ls-remote --exit-code --heads` instead, which is
silent and sets a clean exit code; only fetch/checkout when the branch exists.
This commit is contained in:
Patrick Schratz 2026-07-17 10:32:05 +00:00
commit c10ffe2f75
No known key found for this signature in database
GPG key ID: 62050D5BC68AB6DC

View file

@ -127,7 +127,7 @@ steps:
# clone.
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- git fetch -q origin main
- 'if git fetch -q origin ${patch_branch}; then git checkout -q FETCH_HEAD; else echo "No ${patch_branch} branch; no pending auto-patch proposals to verify."; exit 0; fi'
- 'if git ls-remote --exit-code --heads origin ${patch_branch} >/dev/null 2>&1; then git fetch -q origin ${patch_branch} && git checkout -q FETCH_HEAD; else echo "No ${patch_branch} branch; no pending auto-patch proposals to verify."; exit 0; fi'
- mkdir -p /mnt/cache/R-pkgs
- rm -rf /mnt/cache/R-pkgs/00LOCK-*
- /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R