Last updated:
GitLab Triggers
GitLab triggers start an automation from merge request and comment activity in your connected GitLab groups and projects.
GitLab: Merge Request Trigger
Fires on merge request activity: opened, closed, reopened, merged, approved, and updates such as new commits.
The trigger fires only once the integration's webhook URL is registered in GitLab, on a group or on an individual project. See Set Up GitLab Integration for the webhook steps.
Configuration Fields
- Groups: Optional. Comma-separated full group paths (e.g.
acme/backend). A group covers every project beneath it, at any depth. Specify groups or projects, or explicitly select All groups or All projects. An empty scope is rejected. Do not combine All groups with a Groups list or All projects with a Projects list. - All groups: Optional. Fire for every group the organization has connected. Leave off to name a group or project instead.
- Instances: Optional. Comma-separated instance hosts (e.g.
gitlab.com,gitlab.acme.io). Only needed when the organization has more than one GitLab integration, because a group path is unique within an instance, not across them. - All projects: Optional. Fire for every project on the connected instances.
- Projects: Optional. Comma-separated full project paths (e.g.
acme/backend/api). Groups and Projects are alternatives, so an event matching either fires the automation. - Actions: Optional. Comma-separated merge request actions:
open,close,reopen,update,merge,approved,unapproved. Leave empty to match all actions.
Available Variables
- {{gitlab.instance}}: Instance host the event came from (e.g.
gitlab.com) - {{gitlab.project}}: Full project path (e.g.
acme/backend/api) - {{gitlab.group}}: Full group path (e.g.
acme/backend) - {{gitlab.user}}: GitLab user who triggered the event
- {{gitlab.action}}: Merge request action (e.g.
open,merge) - {{gitlab.merge_request.iid}}: Merge request IID (project-scoped number)
- {{gitlab.merge_request.title}}: Merge request title
- {{gitlab.merge_request.url}}: Direct link to the merge request
Example Prompt
Merge request {{gitlab.action}} in {{gitlab.project}}: "{{gitlab.merge_request.title}}" ({{gitlab.merge_request.url}}).
Review the changes for services that might be affected. Query Dash0 for error rates and latency over the last 7 days, and summarize any concerning patterns.GitLab: Comment Trigger
Fires when a comment is added to a merge request, issue, commit, or snippet. Add a keyword to fire only on comments containing it.
Configuration Fields
Same Groups, All groups, Instances, All projects, and Projects fields as the Merge Request trigger, plus:
- Keyword: Optional. Fires only on comments containing this whole word, case-insensitively. Leave empty to fire on every comment, which on a busy project is a great many.
Available Variables
- {{gitlab.instance}}: Instance host the event came from
- {{gitlab.project}}: Full project path
- {{gitlab.group}}: Full group path
- {{gitlab.user}}: GitLab user who added the comment
- {{gitlab.comment.body}}: Comment text
- {{gitlab.noteable_type}}: What the comment is on (
MergeRequest,Issue,Commit, orSnippet) - {{gitlab.merge_request.iid}}: Merge request IID, when the comment is on a merge request
- {{gitlab.merge_request.title}}: Merge request title, when the comment is on a merge request
- {{gitlab.merge_request.url}}: Link to the merge request, when the comment is on a merge request
Example Prompt
{{gitlab.user}} commented on {{gitlab.noteable_type}} in {{gitlab.project}}.
Comment: "{{gitlab.comment.body}}"
Treat this as a request to investigate. Query Dash0 for the affected service's recent health and reply with your findings.GitLab triggers require the GitLab integration. When an automation acts in GitLab, it acts as the automation's creator, not as a shared bot, because GitLab has no bot identity to fall back on. The creator must have connected their own GitLab account, and read-write work needs a read-write connection. An automation created through the API, the CLI, or Terraform has no recorded creator and cannot act in GitLab. Agent0 raises gitlab_automation_no_acting_user when there is no one to act as. See Use GitLab in Chat and Automations.