Skip to content

ci(close-prs): bun script failures are silent in the run log #42153

Description

@niStee

Problem

When the close-prs workflow runs bun script/github/close-prs.ts and the script fails (GraphQL pagination error, token-scope error, unhandled exception), the workflow step fails silently — the error is buried in the full log with no visible annotation in the run summary.

This makes diagnosing close-prs failures harder than necessary. The run shows "failed" but you have to download the full log to find the error.

Proposed fix

Wrap the bun invocation so a non-zero exit code emits a ::warning:: annotation:

bun script/github/close-prs.ts "${args[@]}" || {
  exit_code=$?
  echo "::warning::close-prs.ts exited with code $exit_code — check logs for GraphQL/token-scope errors"
  exit $exit_code
}

The exit code is still propagated (exit $exit_code), so the workflow step still fails — but the failure reason is visible at a glance in the run summary via the ::warning:: annotation.

Context

  • Workflow file: .github/workflows/close-prs.yml
  • Script: script/github/close-prs.ts
  • Observed on a fork (niStee/opencode) where the same workflow runs against this upstream repo via --repo argument

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions