File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,16 @@ 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 /proc/self/fd/2 | 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
7277
7378 echo "Semver checks exitcode: " $exitcode
You can’t perform that action at this time.
0 commit comments