mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-19 15:18:03 +00:00
fix(ci): fail closed when workspace matrix discovery produces empty list
The set-matrix step wrote the npm workspace query result directly to $GITHUB_OUTPUT. If discovery ever produced [], the matrix would expand to zero check jobs, leaving the reusable workflow green without running any JS/TS checks. Now the step validates the result is a non-empty array before emitting it, and exits 1 with a GitHub annotation if it's empty or jq failed.
This commit is contained in:
parent
7a44a8fdec
commit
7577834206
1 changed files with 6 additions and 1 deletions
7
.github/workflows/js-tests.yml
vendored
7
.github/workflows/js-tests.yml
vendored
|
|
@ -21,7 +21,12 @@ jobs:
|
|||
command: npm ci --ignore-scripts
|
||||
- id: set-matrix
|
||||
run: |
|
||||
echo "packages=$(npm query .workspace | jq -c '[.[].location]')" >> "$GITHUB_OUTPUT"
|
||||
PACKAGES=$(npm query .workspace | jq -c '[.[].location]')
|
||||
if [ "$PACKAGES" = "[]" ] || [ -z "$PACKAGES" ]; then
|
||||
echo "::error::Workspace discovery produced an empty package list — refusing to emit a zero-length matrix (would skip all JS/TS checks silently)."
|
||||
exit 1
|
||||
fi
|
||||
echo "packages=$PACKAGES" >> "$GITHUB_OUTPUT"
|
||||
|
||||
check:
|
||||
name: Typecheck & Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue