@usebruno/cli, run bru.
Prerequisites
- Git installed
- A GitHub repository containing a Bruno workspace
- Node.js (for installing the Bruno CLI)
Demo workspace
To follow along with the video, clone the Bruno Automation Demo Workspace and open it in Bruno.
Create the workflow
- Create the workflow directory:
- Create
.github/workflows/bruno-api-tests.yml:
What this workflow does
Key bru run flags
--global-env ciactivates theciglobal environment defined inenvironments/ci.ymlat the workspace root.--workspace-path ../..tells Bruno where the workspace root is relative to the collection directory. Required when running from inside a collection folder.--tags smoke,workflow,release-gateruns only requests tagged with these values.--env-varoverrides environment variables at runtime, useful for injecting CI-specific values like the GitHub run ID and commit SHA.--reporter-htmlgenerates an HTML report of the test results.
Run the workflow
- Commit and push your workflow file:
-
Monitor the workflow:
- Go to your GitHub repository and click the Actions tab.
- The workflow runs automatically on pushes and pull requests to
main, or trigger it manually with workflow_dispatch.
-
View the report:
- Once the run completes, click into the workflow run.
- Download the bruno-report artifact from the Artifacts section.
- Open
github-actions-report.htmlin your browser for a visual summary of all test results.
Troubleshooting
Sandbox migration (Bruno CLI v3+)
Sandbox migration (Bruno CLI v3+)
Bruno CLI v3 changed the default sandbox to Safe Mode. If your tests rely on Node built-ins (
require, Buffer, etc.), add --sandbox developer to your bru run command:exit-code is non-zero but failed is 0
exit-code is non-zero but failed is 0
The
bru process crashed before writing JUnit, or wrote an empty report. Treat as a runtime error and check the step log for stderr. When using the official action, expand the ::group:: block in the action log to see the full bru invocation, including auto-injected flags.Job failed before bru could run
Job failed before bru could run
If the run log shows a red Install Bruno CLI step, the failure is in
npm install -g @usebruno/cli, not in your collection.Common bru exit codes
Common bru exit codes
See the action README for the full exit-code table.
Network timeouts and proxies
Network timeouts and proxies
Bruno honours
HTTP_PROXY, HTTPS_PROXY, and NO_PROXY. Set them via env: on the step or runner configuration.