# GitLab

> Manage GitLab branches, issues, and merge requests with a personal access token.

App · Code Repositories · 10 actions. Web page: https://docs.lodol.com/docs/integrations/gitlab

## Actions

### Create branch

Create a new branch in a GitLab project from an existing branch or commit.

**Inputs**

- Project (`project`, text, required): The project to act on. Pick one from the list, or enter the project path shown in its web address (for example, 'my-group/my-project') or its numeric project ID.
- New branch name (`branch`, text, required): The name for the new branch (for example, 'feature/login').
- Start from branch (`ref`, text, required): The existing branch to create the new branch from (for example, 'main'). Pick one once you've chosen a project.

**Outputs**: Response envelope; the payload is in the "branch" field.

- `branch` (object)

**Example output**

```json
{
  "branch": {
    "commit_id": "b83d6e391c22777fca1ed3012fce84f633d7fed0",
    "default": false,
    "name": "feature/login",
    "protected": false,
    "web_url": "https://gitlab.com/user/project/-/tree/feature/login"
  }
}
```

### Create comment

Add a comment to a GitLab issue or merge request.

**Inputs**

- Project (`project`, text, required): The project to act on. Pick one from the list, or enter the project path shown in its web address (for example, 'my-group/my-project') or its numeric project ID.
- Comment on (`target_type`, text, required): Whether to comment on an issue or a merge request. One of: `issue`, `merge_request` (Merge request). Default: `issue`.
- Issue or merge request (`target_iid`, number, required): The issue or merge request to comment on. Pick one once you've chosen a project and whether it's an issue or a merge request, or enter its number (for example, 5).
- Comment (`body`, text, required): The text of the comment.

**Outputs**: Response envelope; the payload is in the "note" field.

- `note` (object)

**Example output**

```json
{
  "note": {
    "body": "This is a comment.",
    "id": 101
  }
}
```

### Create issue

Create a new issue in a GitLab project.

**Inputs**

- Project (`project`, text, required): The project to act on. Pick one from the list, or enter the project path shown in its web address (for example, 'my-group/my-project') or its numeric project ID.
- Title (`title`, text, required): The title of the new issue.
- Description (`description`, text): The main text of the issue.
- Labels (`labels`, list): Labels to add to the issue. Pick any number from the project's labels once you've chosen a project.

**Outputs**: Response envelope; the payload is in the "issue" field.

- `issue` (object)

**Example output**

```json
{
  "issue": {
    "id": 789,
    "iid": 2,
    "state": "opened",
    "title": "New feature request",
    "web_url": "https://gitlab.com/user/project/-/issues/2"
  }
}
```

### Create merge request

Create a new merge request in a GitLab project.

**Inputs**

- Project (`project`, text, required): The project to act on. Pick one from the list, or enter the project path shown in its web address (for example, 'my-group/my-project') or its numeric project ID.
- Source branch (`source_branch`, text, required): The branch with the changes you want to merge. Pick one once you've chosen a project.
- Target branch (`target_branch`, text, required): The branch you want to merge the changes into (for example, 'main'). Pick one once you've chosen a project.
- Title (`title`, text, required): The title of the merge request.
- Description (`description`, text): The main text of the merge request.

**Outputs**: Response envelope; the payload is in the "merge_request" field.

- `merge_request` (object)

**Example output**

```json
{
  "merge_request": {
    "id": 555,
    "iid": 3,
    "source_branch": "feature/login",
    "state": "opened",
    "target_branch": "main",
    "title": "Add login page",
    "web_url": "https://gitlab.com/user/project/-/merge_requests/3"
  }
}
```

### Delete branch

Delete a branch from a GitLab project.

**Inputs**

- Project (`project`, text, required): The project to act on. Pick one from the list, or enter the project path shown in its web address (for example, 'my-group/my-project') or its numeric project ID.
- Branch (`branch`, text, required): The branch to delete. Pick one once you've chosen a project.

**Outputs**: Response envelope; the payload is in the "result" field.

- `result` (object)

**Example output**

```json
{
  "result": {
    "branch": "feature/login",
    "deleted": true
  }
}
```

### Delete issue

Permanently delete an issue from a GitLab project.

**Inputs**

- Project (`project`, text, required): The project to act on. Pick one from the list, or enter the project path shown in its web address (for example, 'my-group/my-project') or its numeric project ID.
- Issue (`issue_iid`, number, required): The issue to delete. Pick one once you've chosen a project, or enter its number (for example, 5 for #5).

**Outputs**: Response envelope; the payload is in the "result" field.

- `result` (object)

**Example output**

```json
{
  "result": {
    "deleted": true,
    "iid": 1
  }
}
```

### Delete merge request

Permanently delete a merge request from a GitLab project.

**Inputs**

- Project (`project`, text, required): The project to act on. Pick one from the list, or enter the project path shown in its web address (for example, 'my-group/my-project') or its numeric project ID.
- Merge request (`merge_request_iid`, number, required): The merge request to delete. Pick one once you've chosen a project, or enter its number (for example, 3 for !3).

**Outputs**: Response envelope; the payload is in the "result" field.

- `result` (object)

**Example output**

```json
{
  "result": {
    "deleted": true,
    "iid": 3
  }
}
```

### Get branch

Get details of a single branch in a GitLab project.

**Inputs**

- Project (`project`, text, required): The project to act on. Pick one from the list, or enter the project path shown in its web address (for example, 'my-group/my-project') or its numeric project ID.
- Branch (`branch`, text, required): The branch to look up. Pick one once you've chosen a project.

**Outputs**: Response envelope; the payload is in the "branch" field.

- `branch` (object)

**Example output**

```json
{
  "branch": {
    "commit_id": "b83d6e391c22777fca1ed3012fce84f633d7fed0",
    "default": true,
    "merged": false,
    "name": "main",
    "protected": true,
    "web_url": "https://gitlab.com/user/project/-/tree/main"
  }
}
```

### Get issue

Get details of a specific issue in a GitLab project.

**Inputs**

- Project (`project`, text, required): The project to act on. Pick one from the list, or enter the project path shown in its web address (for example, 'my-group/my-project') or its numeric project ID.
- Issue (`issue_iid`, number, required): The issue to look up. Pick one once you've chosen a project, or enter its number (for example, 5 for #5).

**Outputs**: Response envelope; the payload is in the "issue" field.

- `issue` (object)

**Example output**

```json
{
  "issue": {
    "description": "Steps to reproduce the bug.",
    "id": 456,
    "iid": 1,
    "state": "opened",
    "title": "Bug report",
    "web_url": "https://gitlab.com/user/project/-/issues/1"
  }
}
```

### Get merge request

Get details of a specific merge request in a GitLab project.

**Inputs**

- Project (`project`, text, required): The project to act on. Pick one from the list, or enter the project path shown in its web address (for example, 'my-group/my-project') or its numeric project ID.
- Merge request (`merge_request_iid`, number, required): The merge request to look up. Pick one once you've chosen a project, or enter its number (for example, 3 for !3).

**Outputs**: Response envelope; the payload is in the "merge_request" field.

- `merge_request` (object)

**Example output**

```json
{
  "merge_request": {
    "id": 555,
    "iid": 3,
    "merge_status": "can_be_merged",
    "source_branch": "feature/login",
    "state": "opened",
    "target_branch": "main",
    "title": "Add login page",
    "web_url": "https://gitlab.com/user/project/-/merge_requests/3"
  }
}
```
