Commit e1660b7
authored
fix: surface vp install errors outside collapsed log group (#52)
## Summary
When `vp install` fails inside the action (e.g.
`ERR_PNPM_OUTDATED_LOCKFILE`, yarn integrity mismatch), the actual error
detail is hidden inside a collapsed GitHub Actions log group. GitHub
never auto-expands a group on failure, so users see only `▶ Running vp
install in ...` and have to click to find out why their workflow broke.
Reported from two real CI runs — see [nkzw-tech/web-app-template
run](https://github.com/nkzw-tech/web-app-template/actions/runs/24762713013/job/72449839373)
and [fengmk2/fengmk2.github.com
run](https://github.com/fengmk2/fengmk2.github.com/actions/runs/24758703865/job/72437472489?pr=13).
- Capture stdout/stderr via `exec` listeners while the command runs
(live output still streams into the group).
- On non-zero exit: close the group *before* logging so the failure
renders at top level, and emit the tail of the captured output via
`core.error(...)` so it also appears in the run's Annotations panel.
Tail-capped at 4000 chars.
- Success path is unchanged — still tidy inside the group.
Only `runViteInstall` used a log group; every other step in this action
(`installVitePlus`, `vp env use`, `restoreCache`, `saveCache`) already
logs at top level, so this brings `vp install` in line with the rest.
## Test plan
- [x] `vp run typecheck`
- [x] `vp run check:fix`
- [x] `vp run test` (97 passing)
- [x] `vp run build` (dist regenerated)
- [ ] E2E smoke test: run a workflow pinned to this branch against a
repo with an intentionally out-of-sync lockfile; confirm the installer
error is visible at top level and appears in the Annotations panel
without expanding the group.
- [ ] E2E smoke test: run against a repo with a clean install; confirm
the success path still groups cleanly and logs "Successfully ran vp
install".
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: changes are limited to logging/error-reporting around `vp
install`, but could slightly alter how failures are surfaced and grouped
in GitHub Actions logs.
>
> **Overview**
> Ensures `vp install` failures are visible at the top level of GitHub
Actions logs (and in the Annotations panel) instead of being hidden
inside a collapsed log group.
>
> `runViteInstall` now runs `vp install` via `getExecOutput(...,
ignoreReturnCode: true)`, closes the log group before emitting errors,
and logs a truncated tail (up to 4000 chars) of stdout/stderr via
`core.error` before calling `setFailed` with the exit code.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
697e70a. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 379deda commit e1660b7
2 files changed
Lines changed: 56 additions & 41 deletions
0 commit comments