diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index 4c0899be..2653d5b9 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -240,8 +240,28 @@ jobs: - name: Upload to Minio run: | - curl -X POST "https://chats-release-webhook.starworks.cc:88/sync/${{ github.run_id }}/${{ matrix.id }}" -N \ - -H "Authorization: Basic $(echo -n "${{ secrets.CHATS_RELEASE_WEBHOOK_CREDENTIAL }}" | openssl base64)" + OUTPUT_LOG="curl_output.log" + + echo "Triggering webhook, running in the background..." + nohup bash -c "curl -X POST \"https://chats-release-webhook.starworks.cc:88/sync/${GITHUB_RUN_ID}/${MATRIX_ID}\" -N -H \"Authorization: Basic \$(echo -n '${CREDENTIAL}' | openssl base64)\" | tee -a ${OUTPUT_LOG}" & + CURL_PID=$! + + # Wait for a maximum of 10 seconds to detect a response + RESPONSE_OK=0 + for i in $(seq 1 10); do + echo "Waiting for response... (${i}/10)" + if grep -q "开始同步..." "$OUTPUT_LOG"; then + echo "Response detected, assuming status code is 200. Exiting wait." + RESPONSE_OK=1 + break + fi + sleep 1 + done + + if [ $RESPONSE_OK -ne 1 ]; then + echo "Timeout: Did not detect expected response within 10 seconds." + exit 1 + fi create-release: if: needs.build-fe.outputs.is_release == 'true'