# GitLab Integration

Enhance your GitLab workflow with Argos for streamlined visual testing, direct feedback on merge requests, and easy GitLab repository access.

### Why Argos needs repository access

Argos reads commit history to select the correct [baseline build](/docs/learn/platform-fundamentals/baseline-build.md) and reports statuses back to GitLab. Connecting your repository ensures Argos can compare builds accurately and keep merge requests up to date.

### Advantages of GitLab Integration

* Log in effortlessly via GitLab
* Access to GitLab repositories
* Get Argos feedback on your pull requests.

### Connecting a GitLab Repository

By leveraging GitLab's Personal Access Token, Argos communicates via a dedicated GitLab Bot User. This setup ensures direct feedback on your pull requests.

{% stepper %}
{% step %}

#### Generate a Personal Access Token in GitLab

* Go to [GitLab tokens settings](https://gitlab.com/-/profile/personal_access_tokens?name=argos2\&scopes=api,read_user).
* Click "Add new token".
* Set an expiration date 12 months ahead (maximum allowed).
* Click "Create personal access token" and then copy the generated token.

![Generate a Personal Access Token in GitLab](/files/77e46b7b227ebe26ff1c3a9856999cba6a01c709)

{% hint style="info" %}
You can also use a [Project Access Token](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html) if you want to restrict access to a single project. If you choose this option, be sure to use set the role of the token as **developer**.
{% endhint %}
{% endstep %}

{% step %}

#### Configure the Generated Token in Argos

1. From the dashboard, select your team or your personal account from the scope selector
2. Select the **Settings** tab and go to the **Integrations** section
3. Scroll to **GitLab** section
4. Enter the generated token and click **Save**

![Configure GitLab in Argos](/files/b70b5aaa3463a14ad12d259ce58ec07d7e9ee72c)
{% endstep %}

{% step %}

#### Link GitLab Project to Argos

1. From the dashboard, select your team or your personal account from the scope selector
2. Select the **Projects** tab
3. Click on **Create a new Project** at the top right
4. Select **Continue with GitLab**
5. Pick your GitLab organization and the desired repository, the new project should appear in your projects list

![Configure GitLab in Argos](/files/d14da22355b95096636c09a0f07792148dbf088d)
{% endstep %}
{% endstepper %}

### Connecting a Argos project to a GitLab Repository

First, ensure the [GitLab Personal Access Token has been configured correctly](#connecting-a-gitlab-repository).

In Argos, navigate to "Project Settings" → "Connect Git Repository" and select the desired GitLab repository for association.

### GitLab Self-Managed

GitLab Self-Managed deployments are supported on the Argos Enterprise plan. These setups often require tailored configuration alongside SAML SSO and other enterprise features. To discuss enabling GitLab Self-Managed, [contact sales](mailto:contact@argos-ci.com).


---

# 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://argos-ci.com/docs/learn/integrations/gitlab-integration.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.
