forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcm-builds.sh
More file actions
executable file
·32 lines (28 loc) · 984 Bytes
/
Copy pathcm-builds.sh
File metadata and controls
executable file
·32 lines (28 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
#
# Codemagic Build Status Checker
# Usage: ./cm-builds.sh [limit]
#
LIMIT=${1:-10}
APP_ID="66c95e6ec76853c447b8bcbb"
# Check for API token
if [ -z "$CODEMAGIC_API_TOKEN" ]; then
echo "Error: CODEMAGIC_API_TOKEN not set"
echo "Add to ~/.zshrc: export CODEMAGIC_API_TOKEN=\"your-token\""
exit 1
fi
echo "Recent Codemagic builds (limit: $LIMIT):"
echo "----------------------------------------"
curl -s -H "Authorization: Bearer $CODEMAGIC_API_TOKEN" \
"https://api.codemagic.io/builds?appId=$APP_ID&limit=$LIMIT" | \
jq -r '.builds[] |
(if .status == "building" then "🔨"
elif .status == "finished" then "✅"
elif .status == "failed" then "❌"
elif .status == "skipped" then "⏭️"
elif .status == "queued" then "⏳"
else "❓" end) + " " +
(.index | tostring) + " | " +
.status + " | " +
(.config.name // "unknown") + " | " +
(.createdAt | split("T")[0])'