Skip to main content

GitLab

Create and update issues and merge requests, comment on them, and run, retry or cancel CI/CD pipelines on GitLab.com.

Sluggitlab
Base URLhttps://gitlab.com/api/v4
Auth optionsSign in with GitLab, Personal access token
Test connectionGET /user

1. Choose how to connect​

  • Sign in with GitLab is one click: you approve on GitLab's consent page and you're done. It's only shown when Blokkio offers one-click sign-in for this app; otherwise use the token option below.
  • Personal access token: on GitLab.com open your avatar → Edit profile → Access tokens → Add new token, pick an expiry and the api scope (read_api if you only read), then copy it (glpat-…). A project or group access token (project/group Settings → Access tokens) works too and isn't tied to a person.

2. Create the connection​

  1. In Blokkio, go to Apps and open GitLab.
  2. Click Connect on the option you want. For a token, paste it into Personal access token (or click Use secret) and click Create.
  3. Click Test connection. It calls GET /user.

The app works with GitLab.com. Self-managed GitLab servers aren't supported by this app yet: use the HTTP Request block with a Bearer token connection.

Projects and numbers​

Project takes the numeric project id or the path, for example my-group/my-project (from the project URL). Issue number and Merge request number are the #12 / !34 numbers shown in GitLab (iid), not the global ids.

Run pipeline starts a pipeline for a branch or tag; Variables is a JSON list: [{ "key": "DEPLOY_ENV", "value": "staging" }].

Actions​

Use them with the App Action node. Lists return { items, count }; actions that read every page return { items, pages } (turn off Fetch all pages or lower Max pages in the node to read less).

ActionKeyWhat it doesInputs (required)
List projectslist_projectsProjects you are a member of.Search, Archived
List issueslist_issuesProject, State, Labels, Search, Assignee username, Updated after
Get issueget_issueProject, Issue number
Create issuecreate_issueProject, Title, Description, Labels, Assignee IDs, Milestone ID, Due date, Confidential
Update issueupdate_issueEdit, close or reopen an issue. Only the fields you fill change.Project, Issue number, Title, Description, Close or reopen, Add labels, Remove labels, Assignee IDs, Due date
Comment on issueadd_issue_commentProject, Issue number, Comment, Internal note
List merge requestslist_merge_requestsProject, State, Target branch, Search
Create merge requestcreate_merge_requestProject, Source branch, Target branch, Title, Description, Labels, Assignee IDs, Reviewer IDs, Delete source branch when merged, Squash commits
Comment on merge requestadd_merge_request_commentProject, Merge request number, Comment
List pipelineslist_pipelinesNewest first.Project, Branch or tag, Status
Get pipelineget_pipelineProject, Pipeline ID
Run pipelinerun_pipelineStarts a new pipeline for a branch or tag.Project, Branch or tag, Variables
Retry pipelineretry_pipelineRetries the failed or canceled jobs of a pipeline.Project, Pipeline ID
Cancel pipelinecancel_pipelineProject, Pipeline ID

Triggers​

Use them with the App Trigger node. A trigger checks the app at its polling interval (the shortest allowed depends on your plan, see Plans and limits) and starts one run per new item, oldest first. The first check after you publish only records what already exists, so only items created after that start runs. Each run gets the item as $trigger (for example {{ $trigger.id }}).

TriggerKeyWhat starts a runInputs (required)Output
New issuenew_issueIssues created in a project, newest first.Project, Only with labelsid, iid, title, description, state, web_url, author, created_at
New merge requestnew_merge_requestMerge requests opened in a project, newest first.Project, Target branchid, iid, title, source_branch, target_branch, web_url, author, created_at
New issue (instant)new_issue_instantAn issue is opened (Issue Hook, action open).Projectobject_kind, user, project, object_attributes (iid, title, description, url…), labels
New merge request (instant)new_merge_request_instantA merge request is opened.Projectuser, project, object_attributes (iid, title, source_branch, target_branch, url…)
New push (instant)new_push_instantA push to the project (optionally only one branch).Project, Only this branchref, before, after, user_name, commits, total_commits_count

Instant triggers (marked instant) start a run the moment GitLab sends the event, instead of on the next check. When you publish, Blokkio adds a project webhook (only the events of the trigger) with a random secret token and deletes it when you unpublish. Deliveries are verified with the X-Gitlab-Token header. You need the Maintainer role in the project and a token with the api scope. See App triggers for how they work and what they need.

Troubleshooting​

MessageWhat to do
HTTP 401Wrong or expired token. GitLab tokens always expire; create a new one.
HTTP 403 … insufficient_scopeThe token needs the api scope for write actions.
HTTP 404 … Project Not FoundCheck the project path, and that the token's user is a member.