.github/workflows/bazable.yml file that runs bazable inspect on every pull request to main.
Usage
Options
boolean
Include a
BAZABLE_TOKEN secret reference in the workflow. The generated YAML passes --token ${{ secrets.BAZABLE_TOKEN }} to bazable inspect, enabling headless authentication in CI.boolean
Append Postman/Newman steps to the workflow: export a Postman collection and run
npx newman run postman_collection.json --reporters cli,junit.What it generates
The workflow file (bazable.yml) contains the following steps:
1
Checkout code
Pulls your repository into the runner.
2
Setup Node.js
Ensures Node.js 20 is available.
3
Install Bazable
Installs
bazable-api globally.4
Run contract inspection
Executes
bazable inspect --ci (or with --token if the --token flag was used).If
bazable inspect exits with a non-zero code, the pull request is blocked.Prerequisites
- Your project must contain a valid
bazable.config.json. - If you use
--token, add your Bazable access token as a repository secret namedBAZABLE_TOKEN(Settings → Secrets and variables → Actions → New repository secret).
Examples
Newman workflow snippet
With--newman, the generated .github/workflows/bazable.yml appends:
The generated workflow assumes your default branch is
main. Rename the target branch in .github/workflows/bazable.yml if you use a different one.