Skip to main content

GitLab Integration Guide

Overview

The GitLab integration allows your NINA workflows to interact with the GitLab API to search projects and users, manage issues and merge requests, and work with repository files. It supports both GitLab.com and self-hosted GitLab via configurable server URL, and works with either Personal Access Token (PAT) or OAuth2.

Status

Supported resources and operations:

  • Project: Get, Get Issues, Search
  • Issue: Create, Get, Update
  • Merge Request: Get, Get All
  • File: Get, Create
  • User: Get, Get Projects

Credential Configuration

Authentication Methods

1) Access Token (Personal Access Token)

FieldDescriptionExample
ServerGitLab base URL (self-hosted use your base URL)https://gitlab.com
UserOptional user hint
Access TokenPersonal Access Tokenglpat-xxx...

How to create a Personal Access Token on GitLab.com:

  1. Go to GitLab.com → User menu → Edit profile → Access Tokens (or https://gitlab.com/-/profile/personal_access_tokens)
  2. Name it (e.g., "GitLab Integration Tests")
  3. Set an expiration date (recommended)
  4. Select scopes (permissions) based on your needs, e.g.:
    • api (full API access, recommended for automation)
    • read_api (read-only API)
    • read_user, read_repository (granular read scopes)
  5. Click "Create personal access token"
  6. Copy the token immediately (you won't see it again!)

For self-hosted GitLab, use your instance base URL in Server.

2) OAuth2

FieldDescriptionDefault
ServerGitLab base URLhttps://gitlab.com
Client IDOAuth2 client ID
Client SecretOAuth2 client secret
Auth URLAuthorization URLhttps://gitlab.com/oauth/authorize
Access Token URLAccess Token URLhttps://gitlab.com/oauth/token
ScopeOAuth2 scopesapi,read_user,read_repository

Supported Resources and Operations

Project

OperationDescription
GetGet a project by ID
Get IssuesList issues for a project (filters, sorting, pagination)
SearchSearch across projects, issues, merge requests, users, commits, or code

Issue

OperationDescription
CreateCreate a new issue
GetGet a single issue by IID
UpdateUpdate issue fields (state, title, description, labels, assignees)

Merge Request

OperationDescription
GetGet a single merge request by IID
Get AllGet all merge requests (filters and pagination)

File

OperationDescription
GetGet file contents by path (optionally by ref)
CreateCreate a new file with commit metadata

User

OperationDescription
GetGet user information
Get ProjectsList projects for a user (filters and pagination)

Examples

Get Project Issues

{
"integration_service": "gitlab",
"resource": "project",
"operation": "getIssues",
"parameters": {
"projectId": {"mode": "id", "value": "123"},
"returnAll": false,
"limit": 20,
"additionalFields": {
"state": "opened",
"sort": "created_at",
"order_by": "desc"
}
}
}

Search Projects

{
"integration_service": "gitlab",
"resource": "project",
"operation": "search",
"parameters": {
"scope": "projects",
"search": "security AND stars:>100",
"returnAll": false,
"limit": 10
}
}

Create Issue

{
"integration_service": "gitlab",
"resource": "issue",
"operation": "create",
"parameters": {
"projectId": {"mode": "id", "value": "123"},
"title": "Bug: unexpected error in workflow",
"description": "Steps to reproduce...",
"additionalFields": {"labels": "bug,high-priority"}
}
}

Best Practices

  • Use least-privilege scopes for tokens; prefer read_api where possible.
  • Prefer OAuth2 for multi-user or app contexts.
  • For self-hosted, ensure Server points to your instance base URL.
  • Respect rate limits and implement pagination with returnAll/limit.