Skip to content

Commit a34db70

Browse files
AchoArnoldCopilot
andcommitted
ci: add colored output for build URL and status
Blue for the Cloud Console URL, green for success, red for failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8915db8 commit a34db70

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

.github/workflows/api.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,15 @@ jobs:
9696
--project=httpsms-86c51 \
9797
--sha=${{ github.sha }} \
9898
--format="value(metadata.build.id)")
99-
echo "Build ID: $BUILD_ID"
100-
echo "View build logs: https://console.cloud.google.com/cloud-build/builds/$BUILD_ID?project=httpsms-86c51"
99+
echo -e "Cloud Build: \033[34mhttps://console.cloud.google.com/cloud-build/builds/$BUILD_ID?project=httpsms-86c51\033[0m"
101100
echo ""
102-
echo "Polling build status..."
101+
echo "Polling Cloud Build Status..."
103102
while true; do
104103
STATUS=$(gcloud builds describe "$BUILD_ID" --region=global --project=httpsms-86c51 --format="value(status)")
105104
echo " Status: $STATUS"
106105
case "$STATUS" in
107-
SUCCESS) echo "Build succeeded!"; exit 0 ;;
108-
FAILURE|TIMEOUT|CANCELLED|EXPIRED|INTERNAL_ERROR) echo "Build failed with status: $STATUS"; exit 1 ;;
106+
SUCCESS) echo -e "\033[32mBuild succeeded!\033[0m"; exit 0 ;;
107+
FAILURE|TIMEOUT|CANCELLED|EXPIRED|INTERNAL_ERROR) echo -e "\033[31mBuild failed with status: $STATUS\033[0m"; exit 1 ;;
109108
esac
110109
sleep 30
111110
done

0 commit comments

Comments
 (0)