Skip to content

Commit d780963

Browse files
aapelivclaude
andcommitted
mobile: fail production build job when EAS build doesn't finish
eas build exits 0 even when the build is canceled or errored, so the job went green and wrote the dotenv regardless. Check the terminal status and exit non-zero unless it is finished. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 54829ef commit d780963

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

app/mobile/scripts/production-build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,14 @@ BUILD_ID="$(printf '%s' "$BUILD_JSON" | json_field '[0].id')"
5757
echo "could not determine the EAS build id from the build output" >&2
5858
exit 1
5959
}
60+
# `eas build` exits 0 even when the build ends up canceled or errored, so check
61+
# the terminal status ourselves; otherwise a failed build would still write the
62+
# dotenv and let the submit job ship nothing. Normalize case in case the CLI
63+
# returns FINISHED rather than finished.
64+
BUILD_STATUS="$(printf '%s' "$BUILD_JSON" | json_field '[0].status' | tr '[:upper:]' '[:lower:]')"
65+
if [ "$BUILD_STATUS" != "finished" ]; then
66+
echo "EAS build $BUILD_ID did not finish (status: ${BUILD_STATUS:-unknown})" >&2
67+
exit 1
68+
fi
6069
echo "EAS_BUILD_ID=$BUILD_ID" >> "$DOTENV"
6170
echo "Built $PLATFORM production app: $BUILD_ID"

0 commit comments

Comments
 (0)