DEV

GitLab

GitLab Connection

Put GitLab to Work with @Human Automations and @Human Agents

The GitLab Connection documents all Triggers, Actions and Query Operations available for creating automations via the GitLab API.

What can you do with the GitLab Connection?

  • Connect to the GitLab API in a few clicks

  • Use the related GitLab Operations (see below) in @Human Automations or @Human Agents

Trigger Operations

Project Created

Triggers on: projects/project_created

Triggered when a new GitLab project is created.

Issue Created

Triggers on: issues/issue_created

Triggered when a new issue is created in a GitLab project.

Merge Request Created

Triggers on: merge_requests/merge_request_created

Triggered when a new merge request is opened in a GitLab project.

Action Operations

Action: Create Branch

Action: Create Issue

Action: Create Merge Request

Action: Update Merge Request

Action: Create Commit

Action: Add Note to Issue

Action: Add Note to Merge Request

Action: API Request

Query Operations

Query: Find All Merge Requests

Query: Find Group Merge Requests

Query: Find Project Merge Requests

Example link

Obtaining Access Credentials

To obtain a Personal Access Token (PAT) for GitLab, follow these steps:

Prerequisites

  • A GitLab account (Free or Paid tier).

  • Access to the GitLab UI (web interface).

Steps to Generate a PAT

  1. Log in to your GitLab account at https://gitlab.com (or your self-hosted instance).

  2. Click your profile picture (top-right) → Select "Edit profile".

  3. In the left sidebar, go to "Access Tokens" (under Preferences).

  4. Configure the token:

    • Name: Give it a descriptive name (e.g., CI/CD Automation).

    • Expiration date: Set as needed (or leave blank for no expiry).

    • Scopes (Permissions):

      • Select the required scopes (e.g., api, read_repository, write_repository).

      • For full access (not recommended), check sudo.

  5. Click "Create personal access token".

  6. Copy the token immediately (it will only be shown once).

Done. Use this token for system-to-system authentication.

Configuring Webhooks

  1. Navigate to your GitLab project.

  2. In the left sidebar, select Settings > Webhooks.

  3. Click the Add new webhook button.

  4. Enter the URL of the receiving endpoint in the URL field.

  5. Enter a Secret Token (optional) to secure the webhook.

  6. Select the Trigger Events for which you want to receive notifications (e.g., Push events, Merge request events).

  7. Configure SSL Verification preferences for the endpoint.

  8. Click Add webhook to finalize the configuration.

  9. Test the webhook by clicking the Test dropdown next to your webhook and selecting an event type.

Code (Apache v2.0): Service Connectivity and Metadata

Code (Apache v2.0): List of External Resources and Internal Mapping

Last updated