# GitLab

<div align="left"><img src="/files/w2xgr4jo7Ygq1Lya6l9F" alt=""></div>

## Set up

### Navigate to the Integration settings view

1. Select an app in the top left corner from the Switcher
2. Navigate to **App Settings** by clicking the gear icon (⚙️) at the top of the Timeline sidebar
3. Click on **Integrations** in the sidebar

### **Connect GitLab**

* Find the **GitLab** integration module under the **Version control** section
* Click the **Connect** button
* You’ll be taken through a standard [GitLab app](https://docs.gitlab.com/ee/integration/oauth_provider.html) OAuth flow

{% hint style="warning" %}
You must be logged into GitLab as a user with at least **Developer** permissions in the GitLab org.
{% endhint %}

{% hint style="warning" %}
GitLab OAuth applications are tied to the user account that connected them. If this user account is deactivated from your GitLab organization, your Runway integration will also stop functioning. (This can be corrected by removing and reinstalling the GitLab integration as a new user.)

We recommend that organizations connect to the GitLab OAuth application using a shared service account (e.g. a tools@ or dev@ account) to prevent disruptions to Runway's integration syncing service.
{% endhint %}

* GitLab redirects you back to Runway, Runway presents a dialog:
  * Select the project/repo where your code for this app lives

### **Add a release tag pattern**

* Runway uses this to read tags from GitLab and delineate your releases, and also to generate tags when auto-tagging releases upon completion
* Pattern accepts the string `{version}` as a stand-in for the release version, e.g. `v{version}`

{% hint style="info" %}
Runway expects version strings that adhere to [Semantic Versioning](https://semver.org/) principles — formatted as `x.y.z` (representing `major.minor.patch`).
{% endhint %}

### **Add a release branch pattern**

* For GitFlow or similar, pattern accepts the string `{version}` as a stand-in for the release version, e.g. `release-ios-{version}` &#x20;
  * You can assign different patterns to different types of releases using the **Release type** dropdown
* Omit pattern for trunk-based, e.g. `main` &#x20;
  * Be sure to select **all types** in the **Release type** dropdown

### Add any additional branches

* Working branch: your main working branch, e.g. `development`
* Staging branch: if you create your Release Candidate builds from some branch other than your release branch, set that here
* Deploy branch: if you create your final builds from some branch other than your release branch, set that here

### Adjusting permissions in GitLab

Certain permissions need to be configured in GitLab in order for Runway to execute [automations](/automations/types-of-automations.md).

#### How to update branch protection settings in GitLab

To enable Runway to bypass merge requests in GitLab and push directly to a target branch, follow these steps:

1. In GitLab, select **Main menu > Projects** and find your project
2. On the left sidebar, select **Settings > Repository**
3. Expand **Protected branches**
4. From the **Branch** dropdown list, select the target branch
5. From the **Allowed to push** list, select the user that originally installed the GitLab integration in Runway

{% hint style="warning" %}
GitLab's integration with Runway is OAuth-based, which means that the integration's scopes and permission are tied to those of the GitLab user that ran through the OAuth flow in Runway. To avoid unintentionally granting push access to a specific user (and to avoid integration issues if that user leaves the company), we *strongly suggest* setting up a service account user to use for authentication between GitLab and Runway.
{% endhint %}


---

# 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.runway.team/integrations/version-control/gitlab.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.
