> For the complete documentation index, see [llms.txt](https://argos-ci.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://argos-ci.com/docs/learn/integrations/github-integration.md). Agents can also search and read this documentation through its [MCP server](https://argos-ci.com/docs/~gitbook/mcp).

# GitHub integration

Connect Argos to GitHub for automated visual testing, commit and pull request checks, and baseline selection.

Connect Argos to GitHub for automated visual testing on every pull request and merge queue run. Argos reads commit history to pick the right baseline build and reports results back to GitHub so you can ship with confidence.

### What Argos does on GitHub

* Adds commit and pull request checks, so Argos results can block merges when required in GitHub.
* Posts [pull request comments](https://argos-ci.com/docs/learn/review-workflow/pull-request-comments.md) with the latest build results and links back to Argos.
* Reports each [deployment](https://argos-ci.com/docs/learn/deployments.md) as a [GitHub deployment](#github-deployments), so pull requests show a **View deployment** button.
* Analyzes commit history to find the right merge base and select the correct [baseline build](https://argos-ci.com/docs/learn/platform-fundamentals/baseline-build.md) for visual comparisons.
* Detects [stacked pull requests](https://argos-ci.com/docs/learn/review-workflow/stacked-pull-requests.md) and compares each one with the pull request below it.

This is why Argos asks for repository access: it reads commits to find merge bases, and writes statuses, comments and deployments to report results.

### Commit status names

Argos reports results as [commit statuses](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks) on the pull request's head commit, not as check runs. The status context depends on your setup:

| Context                             | When it is used                                                                                                                                                                        |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `argos`                             | The default — one Argos project on the repository, default build name.                                                                                                                 |
| `argos/<build-name>`                | The build has a custom name (for example `argos/e2e` with `--build-name e2e`), as in [monorepo setups](https://argos-ci.com/docs/learn/how-to-guides/ci-pipelines/monorepos-setup.md). |
| `argos/<project-name>`              | Several Argos projects share the same repository — the project name disambiguates them.                                                                                                |
| `argos/<project-name>/<build-name>` | Several projects share the repository and the build has a custom name.                                                                                                                 |
| `argos/summary`                     | The [summary check](https://argos-ci.com/docs/learn/review-workflow/summary-checks.md) that combines all Argos builds on a commit.                                                     |

Use these exact context names when you configure [required status checks](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-status-checks-before-merging) in branch protection.

#### Which commit receives the status

On GitHub Actions `pull_request` events, `GITHUB_SHA` points to an ephemeral merge commit, not to your branch's head. Argos records that merge commit as the build commit — what you tested is the merged result — but detects the pull request from the event payload and **posts the status on the pull request's head commit**, so the check shows up on your PR as expected.

Special cases:

* On `pull_request_target` events, `GITHUB_SHA` points to the base branch, so Argos uses the pull request head commit as the build commit instead.
* Outside a pull request (a push to a branch), the status is posted on the commit the screenshots were captured from.
* In a [merge queue](#merge-queue-support), the status is posted on the merge group's commit, where the queue reads it, and Argos doesn't comment on the pull request.

To override detection, in a custom pipeline for example, set the `ARGOS_COMMIT` (a full SHA: 40 characters, or 64 in a SHA-256 repository) and `ARGOS_BRANCH` environment variables.

### Commit status states

Each Argos status moves through these GitHub states as the build progresses:

| Build                                                                                     | GitHub state | Description                                  |
| ----------------------------------------------------------------------------------------- | ------------ | -------------------------------------------- |
| Queued                                                                                    | `pending`    | "Build is queued"                            |
| In progress                                                                               | `pending`    | "Build in progress..."                       |
| No changes detected                                                                       | `success`    | "Everything's good!" or "… no changes found" |
| Changes detected                                                                          | `failure`    | "… waiting for your decision"                |
| Changes detected, [reported as pending](#status-while-awaiting-review)                    | `pending`    | "… waiting for your decision"                |
| Changes approved                                                                          | `success`    | "… approved"                                 |
| Changes rejected                                                                          | `failure`    | "… rejected"                                 |
| Changes detected on an auto-approved build                                                | `success`    | "…, automatically approved"                  |
| [Skipped](https://argos-ci.com/docs/learn/how-to-guides/ci-pipelines/skipping-a-build.md) | `success`    | "Build skipped"                              |

Once the comparison is done, the description starts with the screenshot counts, such as "2 changed, 1 added".

A build on an [auto-approved branch](https://argos-ci.com/docs/learn/platform-fundamentals/baseline-build.md#auto-approved-branches) outside a pull request is approved automatically, so its status passes even when it has changes.

Whether a `failure` blocks merging is your choice in GitHub. To block, mark the Argos context as a required status check in a [branch protection rule](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-status-checks-before-merging) or a [ruleset](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#require-status-checks-to-pass-before-merging). Otherwise the status is informational. Argos posts the same states either way.

#### Status while awaiting review

By default, a build with changes to review reports `failure`: the check stays red on the pull request until someone approves or rejects the changes, so a visual change can't go unnoticed.

If your team reads a red check as a broken build, report the wait as `pending` instead:

1. Go to your project **Settings** in Argos.
2. In the **Git** section, locate **Status while awaiting review**.
3. Choose **Report a pending status**.
4. Select **Save**.

The check then waits with "… waiting for your decision" until the review: it turns to `success` when the changes are approved, and to `failure` when they are rejected. The setting covers every Argos status of the project, the [summary check](https://argos-ci.com/docs/learn/review-workflow/summary-checks.md) included, and applies to [GitLab](https://argos-ci.com/docs/learn/integrations/gitlab-integration.md#report-changes-awaiting-review-as-running) as well. Only [project administrators](https://argos-ci.com/docs/learn/account-and-access/team-members-and-roles.md#project-administrator) can change it, in the dashboard or through the `awaitingReviewStatus` field of the [REST API](https://argos-ci.com/docs/api-reference)'s update project endpoint.

A required status check blocks merging while it is pending, just as it does while it fails: the setting changes how the wait looks, not whether it blocks.

[Merge queue](#merge-queue-support) builds are the exception. Nobody reviews them, so a pending status would hold the queue until it times out: their changes always report `failure`, and so does the summary check of the merge group's commit.

### GitHub deployments

Argos reports each [deployment](https://argos-ci.com/docs/learn/deployments.md) to GitHub through the [GitHub Deployments API](https://docs.github.com/en/rest/deployments/deployments). It's on by default, and you can [turn it off](#turn-github-deployments-off) per project. The `argos-deploy/<project>` [commit status](https://argos-ci.com/docs/learn/deployments/use-deployments-in-ci.md#status-checks) and the [pull request comment](https://argos-ci.com/docs/learn/review-workflow/pull-request-comments.md) stay as they are.

* A pull request shows the deployment in its timeline and in its merge box, with a **View deployment** button.
* The repository's **Deployments** panel lists every deployment.
* Workflows can listen to `deployment_status` events, for example to [run tests once a preview is live](https://argos-ci.com/docs/learn/deployments/use-deployments-in-ci.md#run-a-workflow-when-a-preview-is-live).

#### Environments

Argos names the GitHub environments after the Argos project:

| GitHub environment     | Deployments                                                                                                                                       |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<project>/preview`    | [Preview deployments](https://argos-ci.com/docs/learn/deployments/environments.md#preview-deployments)                                            |
| `<project>/production` | [Production deployments](https://argos-ci.com/docs/learn/deployments/environments.md#production-deployments), flagged as a production environment |

For a project named `docs`, the environments are `docs/preview` and `docs/production`. GitHub lists them in the repository's **Settings → Environments**.

If you rename the Argos project, the next deployments go to environments with the new name. The previous environments stay on GitHub until you delete them.

#### Deployment statuses

| Argos deployment               | GitHub status |
| ------------------------------ | ------------- |
| Files are uploading            | `in_progress` |
| Ready                          | `success`     |
| Replaced by a newer deployment | `inactive`    |

A `success` status links to the deployment URL. For a production deployment, it links to your [custom domain](https://argos-ci.com/docs/learn/deployments/urls-and-domains.md#custom-domain) when one is set.

A deployment becomes `inactive` once a newer one replaces it: a newer preview on the same branch, or a newer production deployment. It keeps its own deployment URL.

#### Skipped deployments

Argos doesn't report these deployments to GitHub:

* Deployments authenticated with [tokenless authentication](https://argos-ci.com/docs/learn/integrations/github-actions-authentication.md#tokenless-authentication). Authenticate with a [project token](https://argos-ci.com/docs/learn/account-and-access/project-tokens.md) or [GitHub Actions OIDC](https://argos-ci.com/docs/learn/integrations/github-actions-authentication.md#oidc) to get GitHub deployments.
* Deployments from a pull request opened from a fork.

GitHub runs the repository's `deployment` and `deployment_status` workflows on the deployed commit, with the repository's secrets. So Argos only reports commits your team chose.

Skipped deployments keep their commit status and pull request comment.

#### Accept the Deployments permission

Reporting deployments needs the **Deployments** (read and write) [permission](#required-github-app-permissions) of the Argos GitHub App. If you installed the app before Argos requested it, GitHub asks an owner of your organization to accept the new permission:

1. Go to the [Argos app page on GitHub](https://github.com/apps/argos-ci) and select **Configure**.
2. Pick the organization where Argos is installed.
3. Select **Review request**, then **Accept new permissions**.

Until you accept it, Argos skips GitHub deployments. Everything else keeps working.

#### Turn GitHub deployments off

GitHub deployments are on by default for every project. To turn them off:

1. Go to your project **Settings** in Argos.
2. In the **Deployments** section, locate **GitHub deployments**.
3. Turn off **Create GitHub deployments**.
4. Select **Save**.

The **GitHub deployments** card shows once deployments are enabled on the project and the project is linked to a GitHub repository.

Argos then stops creating GitHub deployments. The ones it already created keep receiving statuses, so they still turn `inactive` once a newer deployment replaces them. The commit status and the pull request comment don't change.

Only [project administrators](https://argos-ci.com/docs/learn/account-and-access/team-members-and-roles.md#project-administrator) can change it, in the dashboard or through the `githubDeploymentEnabled` field of the [REST API](https://argos-ci.com/docs/api-reference)'s update project endpoint (`PATCH /projects/{owner}/{project}`).

### Choose your access level

* **Full access (recommended)**: Argos reads the commit history from GitHub to find the [baseline build](https://argos-ci.com/docs/learn/platform-fundamentals/baseline-build.md), whatever history your CI checkout has. Required for Merge Queue.
* **Limited access (no content)**: Argos never reads your repository content. The Argos SDK finds the baseline from the commit history of your CI checkout instead. Merge Queue is not supported. See [GitHub integration without content permission](#github-integration-without-content-permission).

Use GitHub Connect to log in with your GitHub account, then install the Argos GitHub App to link repositories.

### Install the Argos GitHub App

Argos provides a dedicated GitHub App that connects directly to your repositories, enabling real-time visual testing feedback on pull requests.

1. Visit the [Argos app page on GitHub](https://github.com/apps/argos-ci).
2. Select **Configure** and pick the organization where you want to install Argos.
3. Follow the prompts to complete the installation.

#### Import a GitHub repository to Argos

1. Sign in to Argos and select **Create a new project**.
2. Choose GitHub as your provider, then select **Import your repository**.

#### Update the repositories shared with Argos

1. Go to the [Argos app page on GitHub](https://github.com/apps/argos-ci) and select **Configure**.
2. Select the organization where you want to manage repository access.
3. Under **Repository access**, choose **Only select repositories** and pick the repositories you want to share with Argos.

![Repository access settings for the Argos GitHub App](https://content.gitbook.com/content/0slCNmeVzY3qdh0I85HX/blobs/DgSTCg66b8P2VFZ44ns6/repository%20access%209f17c9ae0a701fcacc914b10dea40a5e.jpg)

#### Who can connect a repository

You don't need to be an owner of the GitHub organization to connect a repository that the Argos GitHub App already covers. Each step takes a different role:

* **Import a repository as a new project**: an [owner](https://argos-ci.com/docs/learn/account-and-access/team-members-and-roles.md#owner-role) of the Argos team, since only owners create projects.
* **Link a repository to an existing project**, in the project's **Settings → Connected Git Repository**: a [project administrator](https://argos-ci.com/docs/learn/account-and-access/team-members-and-roles.md#project-administrator).
* **Install the Argos GitHub App, or add a repository to it**: this happens on GitHub. An owner of the organization can do both, and an admin of a repository can add that repository to an existing installation. See [GitHub's documentation](https://docs.github.com/en/apps/using-github-apps/reviewing-and-modifying-installed-github-apps).

To import or link a repository, your Argos account must also be connected to a GitHub account that can access the repository; Argos asks you to sign in with GitHub if it isn't. Argos only lists the organizations and repositories that this GitHub account can access.

If the repository isn't in the list, check that your GitHub account can access it. If it can, the app doesn't cover the repository yet: **Manage repositories**, at the bottom of the list, opens the Argos app on GitHub, where an owner of the organization or an admin of the repository [adds it](#update-the-repositories-shared-with-argos).

With [GitHub without content access](#github-integration-without-content-permission), Argos lists every repository of your team's installation instead, whatever your GitHub account can access, and only to owners of the Argos team.

### Required GitHub App permissions

Argos needs the following permissions to operate:

* **Contents**: used to find a common commit ancestor between branches
* **Statuses**: used to add statuses to commits
* **Pull requests**: used to add comments in pull requests
* **Deployments** (read and write): used to report [deployments](#github-deployments) to GitHub
* **Actions**: used to re-run an individual GitHub Actions workflow run when a check is retried from Argos, and to look up workflow runs for [tokenless authentication](https://argos-ci.com/docs/learn/integrations/github-actions-authentication.md#tokenless-authentication)

We take your security and privacy seriously. If you have any concerns or questions, please [contact us](https://argos-ci.com/contact).

### Merge Queue support

Argos supports [GitHub's native Merge Queue](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue) out of the box, and can be configured for custom merge queue systems as well.

#### How Argos compares a merge queue build

A merge queue build takes its baseline from your base branch, then applies the changes already approved on the queued pull request (or on each pull request listed in `ARGOS_MERGE_QUEUE_PRS`). Changes you approved on the pull request don't show up again in the queue.

A merge queue build can't be reviewed: Argos shows "This build was triggered in a merge queue and doesn't require a review." If it finds changes that weren't approved on the pull request, its status is `failure` ("waiting for your decision") whatever your [status while awaiting review](#status-while-awaiting-review) setting, so the queue check fails when Argos is a [required status check](#commit-status-states) instead of holding the queue until it times out.

Once GitHub merges the group, your base branch points to the commit the merge queue build tested, so that build can serve as the [baseline](https://argos-ci.com/docs/learn/platform-fundamentals/baseline-build.md) for later builds, and a separate `push` build on the base branch is optional. Like any baseline, the build must be complete, its tests must have passed, it must not be a subset, and it must not be rejected. Pull request builds also [need an approved baseline](https://argos-ci.com/docs/learn/platform-fundamentals/baseline-build.md#when-the-baseline-must-be-approved). A merge queue build counts as approved once its pull request is merged, as long as the build is linked to that pull request (see `GITHUB_TOKEN` below).

#### GitHub Actions setup for GitHub Merge Queue

Listen to both `pull_request` and `merge_group` events so Argos uploads run for PR reviews and for queued merges:

{% code title=".github/workflows/ci.yml" %}

```yaml
name: Visual tests

on:
  pull_request:
  merge_group:

jobs:
  argos:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version: 22
      - run: npm ci
      - run: npm run test:e2e # Run E2E tests with Argos SDK integration
        env:
          ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }} # Argos token stored in GitHub Secrets
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Lets the SDK find the pull request of a merge group
```

{% endcode %}

On `merge_group` events, the SDK reads the pull request from the GitHub API with `GITHUB_TOKEN`. Without it, the build isn't linked to its pull request, and Argos can't apply the changes approved there. If your workflow restricts `GITHUB_TOKEN` permissions, grant `pull-requests: read`.

#### Custom merge queue systems

When you are using a merge queue system other than GitHub’s built-in Merge Queue (like [Mergify](https://mergify.com/)), you can set `ARGOS_MERGE_QUEUE_PRS` to the comma-separated pull request numbers included in the queued build. This tells Argos to treat the upload as a merge queue build and use the right baseline for visual comparisons.

When the queued build contains a single pull request, Argos finds the builds approved on it by branch, so upload under that pull request's branch: set `ARGOS_BRANCH` if your merge queue runs on a branch of its own.

```yaml
steps:
  - name: Upload screenshots to Argos
    env:
      ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
      ARGOS_MERGE_QUEUE_PRS: "101,102"
    run: npm exec -- argos upload ./screenshots
```

### GitHub integration without content permission

If you prefer to use Argos without granting full content access to your repositories, you can integrate via a more restricted setup.

This setup does not support [tokenless authentication](https://argos-ci.com/docs/learn/integrations/github-actions-authentication.md#tokenless-limitations) from GitHub Actions: authenticate with [OIDC](https://argos-ci.com/docs/learn/integrations/github-actions-authentication.md#oidc) or a project token instead.

#### Set up Argos with limited GitHub access

1. From the dashboard, select your team from the scope selector.
2. Select the **Settings** tab and go to the **Integrations** section.
3. Scroll to **GitHub without content access**.
4. Select **Install GitHub App**.

![GitHub without content access settings in Argos](https://content.gitbook.com/content/0slCNmeVzY3qdh0I85HX/blobs/L6FXO6nnmQiYAceS52Fm/github%20light%20settings%20f92cce07ed0ba7ddcd67bdaf4d189c51.jpg)

5. On GitHub, choose the specific repositories where you want to install the Argos app.

![Argos GitHub app without content access](https://content.gitbook.com/content/0slCNmeVzY3qdh0I85HX/blobs/c8R92RerSYyUdZWu3NMl/github%20light%20app%202fab2975617916eb69fa710a113d9882.jpg)

6. Back in Argos, go to the **Projects** tab.
7. Select **Create a new project** at the top right.
8. Select **Continue with GitHub (no-content access)**.

![Argos GitHub app without content access](https://content.gitbook.com/content/0slCNmeVzY3qdh0I85HX/blobs/H0le3fZYi73qd80foBvu/create%20project%2097d56ce76dfd351b29e727076e01021c.jpg)

9. Choose the repository you want to connect.

#### How Argos finds the baseline without content access

Argos can't read your commit history from GitHub, so the Argos SDK reads it in your CI job instead, from the repository the job runs in. It finds the merge base of your branch and its [baseline branch](https://argos-ci.com/docs/learn/platform-fundamentals/baseline-build.md#the-baseline-branch), then sends Argos the commit SHAs of the merge base and its ancestors, never the content of your files. Argos picks the [baseline build](https://argos-ci.com/docs/learn/platform-fundamentals/baseline-build.md#how-argos-selects-the-baseline) among these commits.

On a GitHub Actions `pull_request` event, GitHub tests your branch merged into the tip of the base branch. The SDK then starts from that tip instead of the merge base, so changes already merged into the base branch don't show up as changes of your pull request.

The SDK fetches the history it needs from the `origin` remote, so shallow clones work, including the default `actions/checkout` setup. Without `origin`, it falls back to the local history. When it finds no merge base, the build has no baseline and becomes an [orphan](https://argos-ci.com/docs/learn/platform-fundamentals/baseline-build.md#orphan-builds). To pin the baseline yourself, set [`ARGOS_REFERENCE_COMMIT`](https://argos-ci.com/docs/learn/platform-fundamentals/baseline-build.md#choose-a-custom-baseline-via-sdk).

### GitHub Enterprise

#### GitHub Enterprise Cloud

GitHub Enterprise Cloud works out of the box. Follow the same GitHub App setup described above — no extra configuration is needed in Argos.

#### GitHub Enterprise Server (self-hosted)

Self-hosted GitHub Enterprise Server deployments are supported on the Argos Enterprise plan, which also includes SAML SSO and other advanced features. To upgrade to Enterprise, [contact sales](https://argos-ci.com/contact).

### Authenticating Argos in CI

Uploads from GitHub Actions can authenticate in three ways:

* **`ARGOS_TOKEN`**: a [project token](https://argos-ci.com/docs/learn/account-and-access/project-tokens.md) stored as a GitHub secret (used in the examples above).
* [**GitHub OIDC**](https://argos-ci.com/docs/learn/integrations/github-actions-authentication.md#oidc) — short-lived signed tokens with no secret to manage. Preferred where available.
* [**Tokenless authentication**](https://argos-ci.com/docs/learn/integrations/github-actions-authentication.md#tokenless-authentication) — the automatic fallback for pull requests from forked repositories.

OIDC and tokenless authentication are per-project settings: a project admin [enables them](https://argos-ci.com/docs/learn/integrations/github-actions-authentication.md#enable-oidc-or-tokenless-on-your-project) in **Project Settings → Authentication**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://argos-ci.com/docs/learn/integrations/github-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
