Skip to content

Commit 4fa3eba

Browse files
Merge pull request #34 from charlesabarnes/ci/gangway-deploy-diagnose
gangway deploy: print the status and a non-JSON reply
2 parents 012fc95 + 0ec46a4 commit 4fa3eba

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎.github/workflows/gangway-deploy.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ jobs:
3434
- run: |
3535
set -euo pipefail
3636
oidc=$(curl -fsS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$GANGWAY_API" | jq -r .value)
37+
echo "got an OIDC token"
3738
git archive --format=tar.gz -o source.tar.gz HEAD
3839
code=$(curl -sS -o result.json -w '%{http_code}' -X PUT "$GANGWAY_API/v1/projects/$GANGWAY_PROJECT/branch?sha=$GITHUB_SHA&wait=true" \
3940
-H "Authorization: Bearer $oidc" -H 'content-type: application/gzip' --data-binary @source.tar.gz)
40-
jq '{state: .preview.state, url: .preview.urls[0].url, error: .preview.error, detail: .detail}' result.json
41+
echo "gangway answered HTTP $code"
42+
# A reply that is not JSON (from a proxy, say) is printed as is rather than failing in jq.
43+
jq '{state: .preview.state, url: .preview.urls[0].url, error: .preview.error, detail: .detail}' result.json || cat result.json
4144
test "$code" -lt 300

0 commit comments

Comments
 (0)