github-ci: fail the prep stage when the description cannot be read

Previously, on request failure, the prep stage fall-backed to the
default upstream branches of SV/SU due to not finding the PR body
in the error message.

This commit changes the behavior to fail the prep stage when
the description cannot be read.
pull/16338/head
Lukas Sismis 3 months ago committed by Victor Julien
parent a6b9d0a8ec
commit 8c62c0e6a9

@ -26,8 +26,11 @@ jobs:
# Authenticating moves the limit to 1000+ requests/hour per repo.
GH_TOKEN: ${{ github.token }}
run: |
set -eo pipefail
if test "${PR_HREF}"; then
body=$(curl -s --header "Authorization: Bearer ${GH_TOKEN}" "${PR_HREF}" | jq -r .body | tr -d '\r')
body=$(curl --silent --show-error --fail \
--header "Authorization: Bearer ${GH_TOKEN}" \
"${PR_HREF}" | jq -r '.body' | tr -d '\r')
echo "Parsing branch and PR info from:"
echo "${body}"

Loading…
Cancel
Save