Skip to content

Commit

Permalink
Fix order of executions to preserve return code
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophShyper committed Feb 12, 2023
1 parent a6bd1d2 commit 44c0782
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ if [[ -z "${PR_NUMBER}" ]]; then
COMMAND="hub pull-request -b ${TARGET_BRANCH} -h ${SOURCE_BRANCH} --no-edit ${ARG_LIST[@]}"
echo -e "\nRunning: ${COMMAND}"
URL=$(sh -c "${COMMAND}")
PR_NUMBER=$(gh pr view --json number -q .number ${URL})
# shellcheck disable=SC2181
if [[ "$?" != "0" ]]; then RET_CODE=1; fi
PR_NUMBER=$(gh pr view --json number -q .number "${URL}")
else
echo -e "\nUpdating pull request"
COMMAND="hub api --method PATCH repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER} --field 'body=@/tmp/template'"
Expand Down

0 comments on commit 44c0782

Please sign in to comment.