Skip to content

Commit 661f041

Browse files
Fixing workflow error again.
1 parent 8e0ed32 commit 661f041

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

.github/workflows/eas-android-build.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
outputs:
6565
apk_path: ${{ steps.download.outputs.APK_PATH }}
6666
steps:
67-
- name: Checkout repository # Fix added here
67+
- name: Checkout repository
6868
uses: actions/checkout@v4
6969

7070
- name: Setup Node.js
@@ -78,7 +78,10 @@ jobs:
7878
sudo apt-get update
7979
sudo apt-get install -y jq curl
8080
81-
- name: Verify Project Files # Added verification step
81+
- name: Install Project Dependencies (Including dotenv)
82+
run: npm ci
83+
84+
- name: Verify Project Files
8285
run: |
8386
echo "Current directory contents:"
8487
ls -la
@@ -91,21 +94,17 @@ jobs:
9194
BUILD_ID=${{ needs.build-android.outputs.build_id }}
9295
echo "Starting build monitoring for BUILD_ID: $BUILD_ID"
9396
94-
# Initial check without JSON for better error visibility
95-
npx eas build:view $BUILD_ID || true
96-
9797
RETRY_COUNT=0
9898
MAX_RETRIES=120
9999
SLEEP_TIME=30
100100
101101
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
102102
echo -e "\n=== Attempt $((RETRY_COUNT+1))/$MAX_RETRIES ==="
103103
104-
BUILD_STATUS_JSON=$(npx eas build:view --json $BUILD_ID)
104+
BUILD_STATUS_JSON=$(npx eas build:view --build-id $BUILD_ID --json 2>/dev/null)
105105
echo "Raw API response: $BUILD_STATUS_JSON"
106106
107-
# Validate JSON and check for empty response
108-
if ! echo "$BUILD_STATUS_JSON" | jq empty >/dev/null 2>&1 || [[ -z "$BUILD_STATUS_JSON" ]]; then
107+
if [[ -z "$BUILD_STATUS_JSON" || "$BUILD_STATUS_JSON" == "null" ]]; then
109108
echo "Error: Invalid or empty response from EAS API! Retrying..."
110109
RETRY_COUNT=$((RETRY_COUNT+1))
111110
sleep $SLEEP_TIME
@@ -129,15 +128,15 @@ jobs:
129128
exit 0
130129
;;
131130
132-
"errored"|"canceled")
133-
if [[ "$BUILD_STATUS" == "canceled" ]]; then
134-
echo "Build was canceled! Details:"
135-
else
136-
echo "Build failed! Error details:"
137-
fi
138-
echo "$BUILD_STATUS_JSON" | jq .
139-
exit 1
140-
;;
131+
"errored"|"canceled")
132+
if [[ "$BUILD_STATUS" == "canceled" ]]; then
133+
echo "Build was canceled! Details:"
134+
else
135+
echo "Build failed! Error details:"
136+
fi
137+
echo "$BUILD_STATUS_JSON" | jq .
138+
exit 1
139+
;;
141140
142141
"new"|"in_queue"|"in_progress"|"pending")
143142
echo "Build is still in progress..."

0 commit comments

Comments
 (0)