> ## Documentation Index
> Fetch the complete documentation index at: https://bazable.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# bazable ci

> Generate a GitHub Actions workflow that runs bazable inspect on every pull request.

Generates a `.github/workflows/bazable.yml` file that runs `bazable inspect` on every pull request to `main`.

## Usage

```bash theme={null}
bazable ci
```

## Options

<ParamField query="-t, --token" type="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.
</ParamField>

<ParamField query="--newman" type="boolean">
  Append Postman/Newman steps to the workflow: export a Postman collection and run `npx newman run postman_collection.json --reporters cli,junit`.
</ParamField>

## What it generates

The workflow file (`bazable.yml`) contains the following steps:

<Steps>
  <Step title="Checkout code">
    Pulls your repository into the runner.
  </Step>

  <Step title="Setup Node.js">
    Ensures Node.js 20 is available.
  </Step>

  <Step title="Install Bazable">
    Installs `bazable-api` globally.
  </Step>

  <Step title="Run contract inspection">
    Executes `bazable inspect --ci` (or with `--token` if the `--token` flag was used).
  </Step>
</Steps>

<Note>
  If `bazable inspect` exits with a non-zero code, the pull request is blocked.
</Note>

## Prerequisites

* Your project must contain a valid `bazable.config.json`.
* If you use `--token`, add your Bazable access token as a repository secret named `BAZABLE_TOKEN` (Settings → Secrets and variables → Actions → New repository secret).

## Examples

<CodeGroup>
  ```bash Standard theme={null}
  bazable ci
  ```

  ```bash With token theme={null}
  bazable ci --token
  ```

  ```bash With Newman theme={null}
  bazable ci --newman
  ```
</CodeGroup>

## Newman workflow snippet

With `--newman`, the generated `.github/workflows/bazable.yml` appends:

```yaml theme={null}
- name: Export Postman collection
  run: bazable export --postman -o postman_collection.json

- name: Run Postman collection with Newman
  run: npx newman run postman_collection.json --reporters cli,junit
```

<Note>
  The generated workflow assumes your default branch is `main`. Rename the target branch in `.github/workflows/bazable.yml` if you use a different one.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.