mirror of
https://github.com/Sea-Haven-Industries/.github.git
synced 2026-09-30 07:03:11 +00:00
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.
This commit is contained in:
parent
5d3aed93c3
commit
b7502a3bf8
1 changed files with 1 additions and 2 deletions
|
|
@ -47,8 +47,7 @@ for repo in $repos; do
|
||||||
echo ""
|
echo ""
|
||||||
echo "--- $repo ---"
|
echo "--- $repo ---"
|
||||||
|
|
||||||
existing=$(gh api "repos/$ORG/$repo/contents/$WORKFLOW_PATH" --jq '.sha' 2>/dev/null || true)
|
if gh api "repos/$ORG/$repo/contents/$WORKFLOW_PATH" --jq '.sha' > /dev/null 2>&1; then
|
||||||
if [[ -n "$existing" ]]; then
|
|
||||||
echo "SKIP $repo (workflow already exists)"
|
echo "SKIP $repo (workflow already exists)"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue