GitLab
Create and update issues and merge requests, comment on them, and run, retry or cancel CI/CD pipelines on GitLab.com.
| Slug | gitlab |
| Base URL | https://gitlab.com/api/v4 |
| Auth options | Sign in with GitLab, Personal access token |
| Test connection | GET /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
apiscope (read_apiif 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
- In Blokkio, go to Apps and open GitLab.
- Click Connect on the option you want. For a token, paste it into Personal access token (or click Use secret) and click Create.
- 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).
| Action | Key | What it does | Inputs (required) |
|---|---|---|---|
| List projects | list_projects | Projects you are a member of. | Search, Archived |
| List issues | list_issues | Project, State, Labels, Search, Assignee username, Updated after | |
| Get issue | get_issue | Project, Issue number | |
| Create issue | create_issue | Project, Title, Description, Labels, Assignee IDs, Milestone ID, Due date, Confidential | |
| Update issue | update_issue | Edit, 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 issue | add_issue_comment | Project, Issue number, Comment, Internal note | |
| List merge requests | list_merge_requests | Project, State, Target branch, Search | |
| Create merge request | create_merge_request | Project, Source branch, Target branch, Title, Description, Labels, Assignee IDs, Reviewer IDs, Delete source branch when merged, Squash commits | |
| Comment on merge request | add_merge_request_comment | Project, Merge request number, Comment | |
| List pipelines | list_pipelines | Newest first. | Project, Branch or tag, Status |
| Get pipeline | get_pipeline | Project, Pipeline ID | |
| Run pipeline | run_pipeline | Starts a new pipeline for a branch or tag. | Project, Branch or tag, Variables |
| Retry pipeline | retry_pipeline | Retries the failed or canceled jobs of a pipeline. | Project, Pipeline ID |
| Cancel pipeline | cancel_pipeline | Project, 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 }}).
| Trigger | Key | What starts a run | Inputs (required) | Output |
|---|---|---|---|---|
| New issue | new_issue | Issues created in a project, newest first. | Project, Only with labels | id, iid, title, description, state, web_url, author, created_at |
| New merge request | new_merge_request | Merge requests opened in a project, newest first. | Project, Target branch | id, iid, title, source_branch, target_branch, web_url, author, created_at |
| New issue (instant) | new_issue_instant | An issue is opened (Issue Hook, action open). | Project | object_kind, user, project, object_attributes (iid, title, description, url…), labels |
| New merge request (instant) | new_merge_request_instant | A merge request is opened. | Project | user, project, object_attributes (iid, title, source_branch, target_branch, url…) |
| New push (instant) | new_push_instant | A push to the project (optionally only one branch). | Project, Only this branch | ref, 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
| Message | What to do |
|---|---|
HTTP 401 | Wrong or expired token. GitLab tokens always expire; create a new one. |
HTTP 403 … insufficient_scope | The token needs the api scope for write actions. |
HTTP 404 … Project Not Found | Check the project path, and that the token's user is a member. |