From b7502a3bf8098a4efe8ef7807c85af9366ab5be8 Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Wed, 6 May 2026 18:07:29 -0400 Subject: [PATCH] Fix false-positive existence check in rollout script gh api returns error JSON on 404, which made the variable non-empty. Check exit code instead of output content. --- scripts/rollout-review-workflow.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/rollout-review-workflow.sh b/scripts/rollout-review-workflow.sh index b939fa3..e71c85a 100755 --- a/scripts/rollout-review-workflow.sh +++ b/scripts/rollout-review-workflow.sh @@ -47,8 +47,7 @@ for repo in $repos; do echo "" echo "--- $repo ---" - existing=$(gh api "repos/$ORG/$repo/contents/$WORKFLOW_PATH" --jq '.sha' 2>/dev/null || true) - if [[ -n "$existing" ]]; then + if gh api "repos/$ORG/$repo/contents/$WORKFLOW_PATH" --jq '.sha' > /dev/null 2>&1; then echo "SKIP $repo (workflow already exists)" continue fi