Skip to main content

Overview

Reqbook is a single static binary with stable exit codes, making it straightforward to integrate into any CI pipeline. Common use cases include: validating specs on every pull request, running endpoint tests against staging before a deployment, and detecting secrets committed to spec files before they reach the remote. See the Exit codes reference for a full list of codes and what triggers each one.

Release automation

This repository ships a tag-based release workflow at .github/workflows/release.yml. Push a tag like v0.1.0, or run the release workflow manually with an existing v* tag, to build release binaries, package the VS Code extension, create a GitHub Release, and optionally publish to external package managers. Package-manager publishing is gated by GitHub repository variables. Leave a variable unset or set it to false to keep that channel disabled while still producing GitHub Release artifacts.

GitHub Release artifacts

The release workflow must publish these binary assets because the shell, PowerShell, and npm installers download by exact asset name: Each CLI archive is published with a matching .sha256 file. The workflow fails before and after creating the GitHub Release if any required asset is missing.

Manual release trigger

Manual release runs are for retrying or promoting an existing tag. Create and push the tag first:
Then open GitHub Actions, choose the release workflow, click Run workflow, and enter: The workflow checks out the tag, not the current main branch. The tag must start with v.

Required GitHub configuration

Optional Homebrew variables for a future tap job:

Setting secrets and variables

Open VSX and Homebrew can stay disabled until those channels are ready:
Do not store RQB_* runtime API credentials as release publishing secrets unless a CI test needs them. RQB_* values are for executing API specs, while the package-manager tokens above are for publishing artifacts.

GitHub Actions

1

Install Reqbook

Add a step to download the binary. The install script detects the platform automatically.
2

Validate specs

Run rqb validate against the entire api-docs/ directory. Exit code 2 means a spec has a structural error; exit code 5 means a secret was committed.
3

Run endpoint tests

Pass secrets via RQB_* environment variables. They map automatically to camel-case variable names in your specs.
4

Run pipelines

Use rqb flow for multi-step scenarios that chain request captures across endpoints.

Full workflow example


JUnit reports

Generate JUnit XML output for CI test reporters. Most CI systems can parse JUnit XML to display per-test results inline in pull request checks.
Upload and publish in GitHub Actions:

Passing secrets safely

Use RQB_* environment variables to inject secrets. The RQB_ prefix is stripped and the name is converted to lower camel case before variable resolution.
Do NOT use --var authToken=$SECRET in CI. Shell argument lists may appear in CI logs, exposing the secret value. Always use RQB_* environment variables to pass secrets into Reqbook.

Exit code handling

Treat exit code 4 (network error) differently from exit code 1 (response mismatch) in your CI pipeline. A network error means the staging environment may be down it does not necessarily mean your spec is wrong.

GitLab CI


Pinning the binary version

For reproducible CI builds, pin the Reqbook version explicitly rather than always installing the latest release.
Alternatively, check the binary into your repository under bin/rqb and reference it directly. The binary is statically linked and has no runtime dependencies.