Skip to content

Commit 9a7ed32

Browse files
ci(fix): Capture exit code without failing action (#17813)
1 parent f649083 commit 9a7ed32

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

.github/actions/smoke-test-retry/action.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@ runs:
101101
102102
OUTPUT_FILE="${GITHUB_WORKSPACE}/failed-tests-batch-${BATCH}.txt"
103103
104+
# The parser uses non-zero exit codes as signals (1=error, 2=all_passed,
105+
# 3=no_artifacts), not failures. GitHub runs composite bash steps with
106+
# `-eo pipefail`, so capture the code via `|| EXIT_CODE=$?` to keep
107+
# errexit from aborting the step before the case below can read it.
108+
EXIT_CODE=0
104109
python3 .github/scripts/parse_failed_cypress_tests.py \
105110
--input-dir "${GITHUB_WORKSPACE}/previous-test-results" \
106-
--output "${OUTPUT_FILE}"
107-
108-
EXIT_CODE=$?
111+
--output "${OUTPUT_FILE}" || EXIT_CODE=$?
109112
110113
case $EXIT_CODE in
111114
0)
@@ -139,11 +142,12 @@ runs:
139142
140143
OUTPUT_FILE="${GITHUB_WORKSPACE}/failed-modules-batch-${BATCH}.txt"
141144
145+
# See the cypress parse step: capture the parser's signal exit code via
146+
# `|| EXIT_CODE=$?` so `bash -e` doesn't abort the step before the case.
147+
EXIT_CODE=0
142148
python3 .github/scripts/parse_failed_pytest_tests.py \
143149
--input-dir "${GITHUB_WORKSPACE}/previous-test-results" \
144-
--output "${OUTPUT_FILE}"
145-
146-
EXIT_CODE=$?
150+
--output "${OUTPUT_FILE}" || EXIT_CODE=$?
147151
148152
case $EXIT_CODE in
149153
0)

0 commit comments

Comments
 (0)