diff --git a/.github/workflows/bump-agents-md-callers.yml b/.github/workflows/bump-agents-md-callers.yml index d3e507f..69bdb24 100644 --- a/.github/workflows/bump-agents-md-callers.yml +++ b/.github/workflows/bump-agents-md-callers.yml @@ -97,7 +97,20 @@ jobs: # that run's original (now stale) commit, and the bumper would # force-repin every caller to it. Only act from the current tip — # any newer push has its own queued run that does the bump. - main_tip=$(git ls-remote origin refs/heads/main | cut -f1) + # Don't pipe into `cut`: the pipeline would report cut's status, so a + # failed ls-remote (network blip, remote hiccup) yields an EMPTY + # main_tip that then compares unequal to github.sha and silently + # no-ops the whole fleet bump as if the run were stale. A lookup we + # couldn't perform is not evidence of staleness — fail loudly. + if ! ls_remote=$(git ls-remote origin refs/heads/main); then + echo "::error::Could not look up the current main tip (git ls-remote failed)" + exit 1 + fi + main_tip=${ls_remote%%$'\t'*} + if [[ -z "$main_tip" ]]; then + echo "::error::git ls-remote returned no SHA for refs/heads/main" + exit 1 + fi if [[ "$main_tip" != "$GITHUB_SHA" ]]; then echo "github.sha $GITHUB_SHA is not the current main tip ($main_tip) — stale run/re-run; nothing to bump" exit 0 diff --git a/.github/workflows/bump-assign-reviewers-callers.yml b/.github/workflows/bump-assign-reviewers-callers.yml index 078a2ee..c991aa9 100644 --- a/.github/workflows/bump-assign-reviewers-callers.yml +++ b/.github/workflows/bump-assign-reviewers-callers.yml @@ -102,7 +102,20 @@ jobs: # that run's original (now stale) commit, and the bumper would # force-repin every caller to it. Only act from the current tip — # any newer push has its own queued run that does the bump. - main_tip=$(git ls-remote origin refs/heads/main | cut -f1) + # Don't pipe into `cut`: the pipeline would report cut's status, so a + # failed ls-remote (network blip, remote hiccup) yields an EMPTY + # main_tip that then compares unequal to github.sha and silently + # no-ops the whole fleet bump as if the run were stale. A lookup we + # couldn't perform is not evidence of staleness — fail loudly. + if ! ls_remote=$(git ls-remote origin refs/heads/main); then + echo "::error::Could not look up the current main tip (git ls-remote failed)" + exit 1 + fi + main_tip=${ls_remote%%$'\t'*} + if [[ -z "$main_tip" ]]; then + echo "::error::git ls-remote returned no SHA for refs/heads/main" + exit 1 + fi if [[ "$main_tip" != "$GITHUB_SHA" ]]; then echo "github.sha $GITHUB_SHA is not the current main tip ($main_tip) — stale run/re-run; nothing to bump" exit 0 diff --git a/.github/workflows/bump-cursor-review-callers.yml b/.github/workflows/bump-cursor-review-callers.yml index 36cbb90..db98d7f 100644 --- a/.github/workflows/bump-cursor-review-callers.yml +++ b/.github/workflows/bump-cursor-review-callers.yml @@ -111,7 +111,20 @@ jobs: # that run's original (now stale) commit, and the bumper would # force-repin every caller to it. Only act from the current tip — # any newer push has its own queued run that does the bump. - main_tip=$(git ls-remote origin refs/heads/main | cut -f1) + # Don't pipe into `cut`: the pipeline would report cut's status, so a + # failed ls-remote (network blip, remote hiccup) yields an EMPTY + # main_tip that then compares unequal to github.sha and silently + # no-ops the whole fleet bump as if the run were stale. A lookup we + # couldn't perform is not evidence of staleness — fail loudly. + if ! ls_remote=$(git ls-remote origin refs/heads/main); then + echo "::error::Could not look up the current main tip (git ls-remote failed)" + exit 1 + fi + main_tip=${ls_remote%%$'\t'*} + if [[ -z "$main_tip" ]]; then + echo "::error::git ls-remote returned no SHA for refs/heads/main" + exit 1 + fi if [[ "$main_tip" != "$GITHUB_SHA" ]]; then echo "github.sha $GITHUB_SHA is not the current main tip ($main_tip) — stale run/re-run; nothing to bump" exit 0 diff --git a/.github/workflows/bump-groom-callers.yml b/.github/workflows/bump-groom-callers.yml index c23d8c8..ffe3a61 100644 --- a/.github/workflows/bump-groom-callers.yml +++ b/.github/workflows/bump-groom-callers.yml @@ -127,7 +127,20 @@ jobs: # that run's original (now stale) commit, and the bumper would # force-repin every caller to it. Only act from the current tip — # any newer push has its own queued run that does the bump. - main_tip=$(git ls-remote origin refs/heads/main | cut -f1) + # Don't pipe into `cut`: the pipeline would report cut's status, so a + # failed ls-remote (network blip, remote hiccup) yields an EMPTY + # main_tip that then compares unequal to github.sha and silently + # no-ops the whole fleet bump as if the run were stale. A lookup we + # couldn't perform is not evidence of staleness — fail loudly. + if ! ls_remote=$(git ls-remote origin refs/heads/main); then + echo "::error::Could not look up the current main tip (git ls-remote failed)" + exit 1 + fi + main_tip=${ls_remote%%$'\t'*} + if [[ -z "$main_tip" ]]; then + echo "::error::git ls-remote returned no SHA for refs/heads/main" + exit 1 + fi if [[ "$main_tip" != "$GITHUB_SHA" ]]; then echo "github.sha $GITHUB_SHA is not the current main tip ($main_tip) — stale run/re-run; nothing to bump" exit 0 diff --git a/.github/workflows/bump-pr-size-callers.yml b/.github/workflows/bump-pr-size-callers.yml index 5e9a272..485d34e 100644 --- a/.github/workflows/bump-pr-size-callers.yml +++ b/.github/workflows/bump-pr-size-callers.yml @@ -101,7 +101,20 @@ jobs: # that run's original (now stale) commit, and the bumper would # force-repin every caller to it. Only act from the current tip — # any newer push has its own queued run that does the bump. - main_tip=$(git ls-remote origin refs/heads/main | cut -f1) + # Don't pipe into `cut`: the pipeline would report cut's status, so a + # failed ls-remote (network blip, remote hiccup) yields an EMPTY + # main_tip that then compares unequal to github.sha and silently + # no-ops the whole fleet bump as if the run were stale. A lookup we + # couldn't perform is not evidence of staleness — fail loudly. + if ! ls_remote=$(git ls-remote origin refs/heads/main); then + echo "::error::Could not look up the current main tip (git ls-remote failed)" + exit 1 + fi + main_tip=${ls_remote%%$'\t'*} + if [[ -z "$main_tip" ]]; then + echo "::error::git ls-remote returned no SHA for refs/heads/main" + exit 1 + fi if [[ "$main_tip" != "$GITHUB_SHA" ]]; then echo "github.sha $GITHUB_SHA is not the current main tip ($main_tip) — stale run/re-run; nothing to bump" exit 0