Skip to content

Commit 035c27b

Browse files
fix(ci): guard command captures with set +e/-e to prevent silent abort
GitHub Actions shells run with -eo pipefail. A `VAR=$(cmd 2>&1)` line where cmd exits non-zero causes bash to abort the step immediately, so the GITHUB_ENV heredoc never runs and apply_output arrives empty — which explains the PR comment showing "(No output from inbox_to_schema.py)". Added set +e / set -e brackets around all three command-substitution captures (apply, just test, round-trip) so the exit code is recorded before set -e is re-armed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 35965c6 commit 035c27b

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/excel_inbox.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,15 @@ jobs:
122122
run: |
123123
# Run inbox_to_schema.py from _main_branch/ against the inbox Excel
124124
# (which lives in the PR branch working directory, one level up).
125+
#
126+
# set +e: GitHub Actions shells run with -eo pipefail, which means
127+
# a failed command substitution (OUTPUT=$(cmd)) would abort the shell
128+
# before we can write the output to GITHUB_ENV for the PR comment.
129+
set +e
125130
OUTPUT=$(uv run python scripts/inbox_to_schema.py \
126131
"../${{ env.INBOX_FILE }}" 2>&1)
127132
EXIT_CODE=$?
133+
set -e
128134
129135
echo "$OUTPUT"
130136
@@ -164,9 +170,12 @@ jobs:
164170
steps.apply.outcome != 'failure'
165171
id: test
166172
run: |
167-
# Capture output + exit code; shell continues even on failure (no set -e)
173+
# Capture output + exit code; disable set -e so a failing test suite
174+
# does not abort the shell before we can write to GITHUB_ENV.
175+
set +e
168176
TEST_OUTPUT=$(just test 2>&1)
169177
TEST_EXIT=$?
178+
set -e
170179
171180
echo "$TEST_OUTPUT"
172181
@@ -208,8 +217,10 @@ jobs:
208217
steps.regen_excel.outcome == 'success'
209218
id: roundtrip
210219
run: |
220+
set +e
211221
RT_OUTPUT=$(uv run python scripts/excel_to_schema.py \
212222
"../${{ env.INBOX_FILE }}" 2>&1)
223+
set -e
213224
214225
echo "$RT_OUTPUT"
215226

0 commit comments

Comments
 (0)