# GitHub

![](/files/mtsUhQR5Hu7ZDWxyfxmn)

Integrate with GitHub to streamline testing into your CI/CD pipeline, providing real-time feedback within your repository. Run tests and suites on BugBug Cloud to ensure that only high-quality, thoroughly tested code is deployed to production environments, reducing the risk of introducing regressions or bugs.

Currently, it is possible to integrate in two ways:

1. Using [official GitHub Action](#official-github-action) **(recommended)**
2. Via [BugBug Command Line Interface (CLI)](/integrations/api.md)

## Official GitHub Action

GitHub Actions allows developers to create automated workflows directly within their GitHub repositories. Integrating with [BugBug Cloud Runner](https://github.com/marketplace/actions/bugbug-cloud-runner) lets them seamlessly incorporate testing into your CI/CD pipeline to receive instant feedback on test results and quickly identify issues.

{% hint style="warning" %}
Keep in mind that BugBug Cloud Runner is only available on paid plans. \
More information about pricing can be found here: <https://bugbug.io/pricing/>
{% endhint %}

To add BugBug action to your workflow:

1. Go to the "Integrations" page
2. Find GitHub on the integrations list
3. Click on the "Manage" button
4. Continue by clicking on the "Open Github Action" button
5. Follow the instructions on [GitHub Marketplace](https://github.com/marketplace/actions/bugbug-cloud-runner) to add BugBug Cloud Runner to your .yml files

{% hint style="info" %}
Find your API token by following the instructions provided [here](/integrations/api.md#get-your-api-token).

Discover where to find your suite ID by referring to the information available on this [page](/integrations/api.md#find-your-suite-id).
{% endhint %}

### Use CLI in GitHub Actions

You can also use the BugBug CLI in a workflow.

```yaml
name: BugBug tests

on:
  push:
    branches:
      - main

jobs:
  e2e:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm install -g @testrevolution/bugbug-cli
      - run: bugbug config set-token "$BUGBUG_API_TOKEN"
        env:
          BUGBUG_API_TOKEN: ${{ secrets.BUGBUG_API_TOKEN }}
      - run: bugbug remote run suite <suite-id>
```

Store the API token as a GitHub Actions secret. Do not commit it to the repository.

### Use Public API or incoming webhooks

Use the Public API if your workflow needs to list tests, start runs, stop runs, check statuses, or download reports programmatically.

Use incoming webhooks if GitHub only needs to trigger a test or suite with a single `POST` request.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bugbug.io/integrations/github.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
