AptlyStar

Gitlab

Available Gitlab triggers for automating workflows

Gitlab provides 6 triggers for automating workflows based on events.

Triggers

GitLab All Events

Trigger workflow on any GitLab project webhook event (push, MR, issue, pipeline, etc.)

Configuration

ParameterTypeRequiredDescription
accessTokenapi-key-pickerYesUsed to create the webhook in your project. Requires the Maintainer or Owner role.
projectIdstringYesThe GitLab project to register the webhook on.
hoststringNoSelf-managed GitLab host. Leave blank for gitlab.com.

Output

ParameterTypeDescription
object_kindstringEvent kind (push, merge_request, issue, etc.)
event_typestringGitLab event type from the X-Gitlab-Event header
userjsonActor that triggered the event (when present)
object_attributesjsonEvent-specific attributes (varies by object_kind)

GitLab Comment

Trigger workflow when a comment is added or updated on an issue or merge request

Configuration

ParameterTypeRequiredDescription
accessTokenapi-key-pickerYesUsed to create the webhook in your project. Requires the Maintainer or Owner role.
projectIdstringYesThe GitLab project to register the webhook on.
hoststringNoSelf-managed GitLab host. Leave blank for gitlab.com.

Output

ParameterTypeDescription
object_kindstringEvent kind (note)
event_typestringGitLab event type from the X-Gitlab-Event header
object_attributesobjectobject_attributes output from the tool
↳ idnumberComment ID
↳ notestringComment body
↳ noteable_typestringWhat the comment is on (Commit, MergeRequest, Issue, Snippet)
↳ actionstringAction (create, update)
↳ urlstringComment URL

GitLab Issue

Trigger workflow when an issue is opened, updated, or closed

Configuration

ParameterTypeRequiredDescription
accessTokenapi-key-pickerYesUsed to create the webhook in your project. Requires the Maintainer or Owner role.
projectIdstringYesThe GitLab project to register the webhook on.
hoststringNoSelf-managed GitLab host. Leave blank for gitlab.com.

Output

ParameterTypeDescription
object_kindstringEvent kind (issue)
event_typestringGitLab event type from the X-Gitlab-Event header
object_attributesobjectobject_attributes output from the tool
↳ idnumberGlobal issue ID
↳ iidnumberProject-scoped issue number
↳ titlestringIssue title
↳ statestringState (opened, closed)
↳ actionstringAction (open, close, reopen, update)
↳ descriptionstringIssue description
↳ confidentialbooleanWhether the issue is confidential
↳ urlstringIssue URL

GitLab Merge Request

Trigger workflow when a merge request is opened, updated, merged, or closed

Configuration

ParameterTypeRequiredDescription
accessTokenapi-key-pickerYesUsed to create the webhook in your project. Requires the Maintainer or Owner role.
projectIdstringYesThe GitLab project to register the webhook on.
hoststringNoSelf-managed GitLab host. Leave blank for gitlab.com.

Output

ParameterTypeDescription
object_kindstringEvent kind (merge_request)
event_typestringGitLab event type from the X-Gitlab-Event header
object_attributesobjectobject_attributes output from the tool
↳ idnumberGlobal merge request ID
↳ iidnumberProject-scoped merge request number
↳ titlestringMerge request title
↳ statestringState (opened, closed, merged, locked)
↳ actionstringAction (open, close, reopen, update, merge, etc.)
↳ source_branchstringSource branch
↳ target_branchstringTarget branch
↳ merge_statusstringMerge status
↳ draftbooleanWhether the merge request is a draft
↳ urlstringMerge request URL

GitLab Pipeline

Trigger workflow when a CI/CD pipeline status changes

Configuration

ParameterTypeRequiredDescription
accessTokenapi-key-pickerYesUsed to create the webhook in your project. Requires the Maintainer or Owner role.
projectIdstringYesThe GitLab project to register the webhook on.
hoststringNoSelf-managed GitLab host. Leave blank for gitlab.com.

Output

ParameterTypeDescription
object_kindstringEvent kind (pipeline)
event_typestringGitLab event type from the X-Gitlab-Event header
object_attributesobjectobject_attributes output from the tool
↳ idnumberPipeline ID
↳ statusstringPipeline status (success, failed, running, etc.)
↳ detailed_statusstringDetailed pipeline status
↳ refstringRef the pipeline ran on
↳ shastringCommit SHA
↳ sourcestringPipeline source (push, web, schedule, etc.)
↳ durationnumberPipeline duration in seconds
↳ urlstringPipeline URL

GitLab Push

Trigger workflow when code is pushed to a GitLab repository

Configuration

ParameterTypeRequiredDescription
accessTokenapi-key-pickerYesUsed to create the webhook in your project. Requires the Maintainer or Owner role.
projectIdstringYesThe GitLab project to register the webhook on.
hoststringNoSelf-managed GitLab host. Leave blank for gitlab.com.

Output

ParameterTypeDescription
object_kindstringEvent kind (push)
event_typestringGitLab event type from the X-Gitlab-Event header
refstringGit ref that was pushed (e.g. refs/heads/main)
branchstringBranch name derived from ref
beforestringSHA before the push
afterstringSHA after the push
checkout_shastringSHA of the most recent commit
user_usernamestringUsername of the pusher
user_namestringDisplay name of the pusher
user_emailstringEmail of the pusher
total_commits_countnumberNumber of commits in the push
commitsjsonArray of commit objects included in this push

On this page