Skip to main content
GitHub Actions lets you automate API testing directly from your repository. Bruno ships an official GitHub Action that installs @usebruno/cli, runs your bru command, and exposes machine-readable test counts. PR comments, annotations, artifact upload, and soft-fail behavior are handled by standard GitHub Actions ecosystem tools documented in Pairing with downstream actions.

Official GitHub Action

The action is a composite action. It prepends bru to your command input, auto-injects --reporter-junit when absent, parses the JUnit summary, and exposes exit-code, passed, failed, total, and duration-ms as step outputs. The workflow step fails naturally when bru exits non-zero.
Write run --env prod, not bru run --env prod. The action prepends bru for you.

Quick start

This minimal workflow installs the CLI, runs the collection, and populates count outputs. The step turns red on assertion failure and green on success. No PR comments, annotations, Step Summary, or uploaded artifacts are created by default. See Pairing with downstream actions for those patterns.

How this workflow works

A GitHub Actions workflow is a YAML file in .github/workflows/. Each line tells GitHub what to run and when. Here is what the quick start example means: In plain terms: GitHub checks out your code, moves into your collection folder, installs Bruno CLI, runs your collection against the prod environment, and reports pass or fail.

Inputs

CLI flags such as --env, --env-var, --tags, --bail, --sandbox, and --reporter-* go in command, not as separate action inputs. Every CLI flag works the day it ships in the CLI.

Outputs

Available as ${{ steps.<id>.outputs.<name> }} in subsequent steps: Report file paths are intentionally not outputs. Pass an explicit --reporter-junit <path> in command and reference that path in downstream steps.

Behavior

JUnit auto-injection (always-on). If command does not contain --reporter-junit, the action appends --reporter-junit "$RUNNER_TEMP/bruno-junit.xml" before invoking bru. A minimal command: 'run' still produces count outputs. If you pass --reporter-junit some/path.xml, the action uses your path. Exit code propagation. The step succeeds on exit 0 and fails on non-zero. To continue the workflow past failures, use GitHub’s built-in continue-on-error: true on the step.

Versioning

The v<major> tag is retagged automatically on every published release.

Workspace structure

The demo workspace is organized as a Bruno workspace with an OpenCollection layout:
Key items:
  • workspace.yml defines the workspace and points to the collection at collections/bruno-automation-demo.
  • environments/ci.yml is a global environment with variables like bruno_echo_url, platform_name, and build_id.
  • collections/bruno-automation-demo/ contains folders of requests with tests and assertions.

Run the demo with the action

What this does: A fuller real-world example using the demo workspace above. It runs tagged requests with a global environment, injects CI variables (build_id, commit_sha), generates an HTML report, and uploads it as an artifact.

Other CI platforms

Bruno CLI also works on Jenkins, Azure DevOps, GitLab CI, and Bitbucket Pipelines via direct CLI invocation or the Bruno CLI Docker image. See Jenkins Integration for Jenkins-specific examples.

Resources