Skip to content

Commit 9b851b5

Browse files
glentnerclaude
andcommitted
Fail the aggregate check on an empty result set
A `for` loop over an empty list runs zero iterations and exits zero, so if the needs expression ever came back empty the gate would pass without having checked anything. Cheap insurance against a status check that silently means nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent acb7425 commit 9b851b5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ jobs:
7373
run: |
7474
results="${{ join(needs.*.result, ' ') }}"
7575
echo "upstream job results: ${results}"
76+
if [ -z "${results}" ]; then
77+
echo "::error::no upstream job results; refusing to pass vacuously"
78+
exit 1
79+
fi
7680
for result in ${results}; do
7781
if [ "${result}" != "success" ]; then
7882
echo "::error::a required job reported '${result}'"

0 commit comments

Comments
 (0)