File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -63,15 +63,20 @@ jobs:
6363 - name : Verify the API compatibilty with PR base
6464 id : semver-pr-check
6565 run : |
66- set +e
66+ set -e # So that failed commands exit the script
67+ set -o pipefail # So that if a command in a pipe fails, the whole command fails
68+
6769 echo "output<<SEMVER_STDOUT_EOF" >> $GITHUB_OUTPUT
70+ SEMVER_REV_OUTPUT=$(make semver-rev rev="$PR_BASE" 2>&1) && true # "&& true" preserves exit code but cancels effects of set -e
71+ exitcode=$?
72+
6873 # Weird sed strip ANSI colors from output
69- make semver-rev rev="$PR_BASE" |& tee /dev/tty | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" >> $GITHUB_OUTPUT
70- exitcode=${PIPESTATUS[0]}
74+ # If any of the commands below fail, `set -e` and `set -o pipefail` should exit the script
75+ echo "${SEMVER_REV_OUTPUT}" | tee /proc/self/fd/2 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" >> $GITHUB_OUTPUT
7176 echo "SEMVER_STDOUT_EOF" >> $GITHUB_OUTPUT
77+
78+ echo "Semver checks exitcode: " $exitcode
7279 echo "exitcode=$exitcode" >> $GITHUB_OUTPUT
73- exit "$exitcode"
74- continue-on-error : true
7580
7681 semver-pull-request-label :
7782 runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments