Skip to content

Add an opt-out for bun run --filter output prefixes so GitHub Actions annotations survive #43484

Open

Description

@lnwu

What is the problem this feature would solve?

bun test automatically emits GitHub Actions workflow commands in CI (::group::<file> / ::endgroup:: per test file, ::error file=...:: for failing tests), and bun run --filter / --workspaces prefixes every output line with <package> <script>: . The runner only parses a workflow command when the line starts with :: (it trims leading whitespace first), so the prefixed commands are logged as literal text: groups never collapse and failure annotations (file/line) never appear.

Minimal workspace:

package.json

{ "name": "repro", "private": true, "workspaces": ["packages/*"] }

packages/a/package.json (same for b)

{ "name": "a", "type": "module", "scripts": { "test": "bun test" } }

packages/a/a.test.ts

import { test, expect } from "bun:test";
test("ok", () => { expect(1).toBe(1); });
$ GITHUB_ACTIONS=true bun run --filter '*' test
a test: bun test v1.4.2 (50a8a8387)
b test: bun test v1.4.2 (50a8a8387)
a test: ::group::a.test.ts:
b test: ::group::b.test.ts:
b test: (pass) ok [0.04ms]
b test: ::endgroup::
a test: (pass) ok [0.05ms]
a test: ::endgroup::

Running the same script directly keeps the commands at the start of the line, and the runner collapses the group:

$ cd packages/a && GITHUB_ACTIONS=true bun test
bun test v1.4.2 (50a8a8387)

::group::a.test.ts:
(pass) ok [0.04ms]

::endgroup::

This breaks the combination the docs promote (the automatic GitHub Actions reporter plus --filter for monorepos), and there is no way to opt out today: bun run --help (1.4.2) has --elide-lines, --filter, --parallel, --no-exit-on-error, but nothing for the prefix, and bun test --reporter only accepts junit and dots — the automatic GitHub Actions reporter cannot be disabled either.

In a real workspace this showed up as literal ::group::test/...: lines in the job log, and a failing integration test's ::error file=packages/core/src/harness.ts,line=324,... was swallowed the same way (no annotation on the run page).

What is the feature you are proposing to solve the problem?

A way to keep workflow commands intact when running workspace scripts, for example:

  1. An opt-out for the prefix (flag / env var / bunfig.toml). pnpm shipped exactly this for the same problem: --reporter-hide-prefix with --reporter=append-only, described as "This can be useful if you are running on CI and the output must be in a specific format without any prefixes (e.g. GitHub Actions annotations)" (Enable customizable output formatting for recursive runs pnpm/pnpm#7061).
  2. Do not prefix output lines that are workflow commands (::...::). Since the runner trims leading whitespace before matching, even a whitespace-only prefix would keep them parseable.
  3. Suppress the GitHub Actions reporter in children spawned by --filter / --workspaces (the child is not the top-level producer).

Caveat for (2): with packages running in parallel their groups interleave (a opens, b opens, b closes, a closes — see the output above), so an explicit opt-out (1) or (3) avoids making that trade-off for the user.

What alternatives have you considered?

  • Run each package's script from its own directory in CI instead of --filter: works today, but loses parallelism and the --if-present skip (this is the workaround in the workspace where I hit it).
  • Strip the prefixes downstream (... | sed ...): fragile — parallel writes, test output that itself contains : , and exit-code plumbing.
  • bun test --reporter=junit plus a test-report action: annotations come from the action instead, but it is an extra dependency and produces no collapsible groups.
  • concurrently --prefix none as the runner: loses Bun's workspace scheduling.

Activity

  1. changed the title [-]`bun test` GitHub Actions groups/annotations are swallowed by `bun run --filter`'s output prefix[/-] [+]Add an opt-out for `bun run --filter` output prefixes so GitHub Actions annotations survive[/+] on Sep 19, 2026
  2. robobun commented on Sep 19, 2026

    @robobun
    Collaborator

    Reproduced on 1.4.3: GITHUB_ACTIONS=true bun run --filter "*" test prefixes every ::error file= line, so the runner parses none of them.
    Fix in progress: #43545

  3. added
    cliSomething to do with CLI arguments
    enhancementNew feature or request
    on Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliSomething to do with CLI argumentsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions