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

# Bitrise

> Connect Bitrise for enhanced failure analysis and automatic fixes

Gitar reads the log of every failing Bitrise build and analyzes it.

Bitrise reports a build to the pull request as a status check. That status links to the build, and Gitar fetches the log from the link.

## Prerequisites

* Confirm Bitrise reports build results to your pull requests as a status check.
* Get admin access to your Bitrise workspace, which is what creating a workspace token needs.

## Setup

**1. Create a workspace API token**

1. Sign in to Bitrise and open **Workspace Settings**.
2. Go to the **Security** tab.
3. Click **Create token** and name it `Gitar`.
4. Set **Expiration** according to your security policy, or leave it unset.
5. Under **Role access**, choose **All apps** and set the role to **Developer** or higher.
6. Click **Create**, then copy the token. Bitrise shows it once.

> [!NOTE]
>
> A workspace token needs the **Developer** role or higher to read build logs, and it belongs to the workspace rather than to a user account, so it keeps working when people leave.
>
> If you do set an expiration, note the date somewhere. An expired token stops log fetching, and the first sign of it is a red build Gitar says nothing about.

**2. Enter the token in Gitar**

1. Go to your Gitar organization settings.

2. Open **Integrations**.

3. Find **Bitrise** and click **Connect**.

4. Paste the token into **Bitrise Token**.

5. Click **Connect** to save. The card's button changes to **Configure** once the token validates.

Bitrise integration form with the workspace token field

## What Gitar reads

Gitar reads the log of a failing build and passes it to CI failure analysis. It ignores a passing build, and writes nothing back to Bitrise. Results appear as a comment on the pull request.

See [CI failure analysis](https://docs.gitar.ai/features/ci-failure-analysis.md).

## Troubleshooting

> [accordion] Gitar does not comment on a failed build
>
> Check the pull request for a Bitrise status check.
>
> If there is no status, Bitrise is not reporting to your Git provider. Check that the repository is connected to both your Git provider and Bitrise, and that the app is set up in Bitrise.

> [accordion] The token is rejected
>
> Check that you created a Workspace API token, not a personal access token.
>
> Check that the token has not expired. Tokens are listed under **Workspace Settings > Security**.

> [accordion] Log fetching fails on a build that exists
>
> The token resolves but does not reach that app. Give it **All apps** with the **Developer** role or higher, or add the app to the token's role access.

## Security notes

* Gitar encrypts credentials and stores them in AWS Secrets Manager.
* A workspace token is not tied to a user account, so access survives people leaving.
* Grant the **Developer** role and no more. Gitar writes nothing to Bitrise.
* To revoke access, delete the token from **Workspace Settings > Security**.


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