| 1 |
#!/bin/bash -ex |
| 2 |
# |
| 3 |
# Copyright The OpenTelemetry Authors |
| 4 |
# SPDX-License-Identifier: Apache-2.0 |
| 5 |
|
| 6 |
BRANCH=main |
| 7 |
WORKFLOW=build-and-test |
| 8 |
|
| 9 |
RESULT=$(gh run list --branch "${BRANCH}" --json status --jq '[.[] | select(.status != "queued" and .status != "in_progress")][0].status' --workflow "${WORKFLOW}" --repo "${REPO}" ) |
| 10 |
if [ "${RESULT}" != "completed" ]; then |
| 11 |
echo "Build status in ${REPO} is not completed: ${RESULT}" |
| 12 |
gh run list --branch "${BRANCH}" --json status,url --jq '[.[] | select(.status != "queued" and .status != "in_progress")][0].url' --workflow "${WORKFLOW}" --repo "${REPO}" |
| 13 |
exit 1 |
| 14 |
fi |