Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
464 changes: 464 additions & 0 deletions apps/docs/content/docs/en/integrations/gitlab.mdx

Large diffs are not rendered by default.

347 changes: 344 additions & 3 deletions apps/sim/blocks/blocks/gitlab.ts

Large diffs are not rendered by default.

152 changes: 144 additions & 8 deletions apps/sim/lib/integrations/integrations.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"updatedAt": "2026-06-18",
"updatedAt": "2026-06-25",
"integrations": [
{
"type": "onepassword",
Expand Down Expand Up @@ -5628,11 +5628,90 @@
{
"name": "Cancel Pipeline",
"description": "Cancel a running GitLab pipeline"
},
{
"name": "List Repository Tree",
"description": "List files and directories in a GitLab project repository"
},
{
"name": "Get File",
"description": "Get the contents of a file from a GitLab project repository"
},
{
"name": "Create File",
"description": "Create a new file in a GitLab project repository"
},
{
"name": "Update File",
"description": "Update an existing file in a GitLab project repository"
},
{
"name": "List Commits",
"description": "List commits in a GitLab project repository"
},
{
"name": "List Branches",
"description": "List branches in a GitLab project repository"
},
{
"name": "Create Branch",
"description": "Create a new branch in a GitLab project repository"
},
{
"name": "Get MR Changes",
"description": "Get the file changes (diffs) of a GitLab merge request"
},
{
"name": "Approve Merge Request",
"description": "Approve a GitLab merge request"
},
{
"name": "List Pipeline Jobs",
"description": "List jobs for a GitLab pipeline"
},
{
"name": "Get Job Log",
"description": "Get the log (trace) of a GitLab job"
},
{
"name": "Play Job",
"description": "Trigger (play) a manual GitLab job"
}
],
"operationCount": 19,
"triggers": [],
"triggerCount": 0,
"operationCount": 31,
"triggers": [
{
"id": "gitlab_push",
"name": "GitLab Push",
"description": "Trigger workflow when commits are pushed to a GitLab project"
},
{
"id": "gitlab_merge_request",
"name": "GitLab Merge Request",
"description": "Trigger workflow when a merge request is opened, updated, or merged in GitLab"
},
{
"id": "gitlab_issue",
"name": "GitLab Issue",
"description": "Trigger workflow when an issue is opened, updated, or closed in GitLab"
},
{
"id": "gitlab_pipeline",
"name": "GitLab Pipeline",
"description": "Trigger workflow when a pipeline status changes in GitLab"
},
{
"id": "gitlab_comment",
"name": "GitLab Comment",
"description": "Trigger workflow when a comment is added on a commit, merge request, or issue"
},
{
"id": "gitlab_webhook",
"name": "GitLab Event",
"description": "Trigger workflow from any GitLab webhook event"
}
],
"triggerCount": 6,
"authType": "api-key",
"category": "tools",
"integrationType": "devops",
Expand Down Expand Up @@ -11233,8 +11312,39 @@
}
],
"operationCount": 6,
"triggers": [],
"triggerCount": 0,
"triggers": [
{
"id": "pagerduty_incident_triggered",
"name": "PagerDuty Incident Triggered",
"description": "Trigger workflow when a new incident is triggered in PagerDuty"
},
{
"id": "pagerduty_incident_acknowledged",
"name": "PagerDuty Incident Acknowledged",
"description": "Trigger workflow when an incident is acknowledged in PagerDuty"
},
{
"id": "pagerduty_incident_resolved",
"name": "PagerDuty Incident Resolved",
"description": "Trigger workflow when an incident is resolved in PagerDuty"
},
{
"id": "pagerduty_incident_escalated",
"name": "PagerDuty Incident Escalated",
"description": "Trigger workflow when an incident is escalated in PagerDuty"
},
{
"id": "pagerduty_incident_reassigned",
"name": "PagerDuty Incident Reassigned",
"description": "Trigger workflow when an incident is reassigned in PagerDuty"
},
{
"id": "pagerduty_webhook",
"name": "PagerDuty Incident Event",
"description": "Trigger workflow from any PagerDuty incident event"
}
],
"triggerCount": 6,
"authType": "api-key",
"category": "tools",
"integrationType": "observability",
Expand Down Expand Up @@ -18289,8 +18399,34 @@
}
],
"operationCount": 26,
"triggers": [],
"triggerCount": 0,
"triggers": [
{
"id": "zendesk_ticket_created",
"name": "Zendesk Ticket Created",
"description": "Trigger workflow when a new ticket is created in Zendesk"
},
{
"id": "zendesk_ticket_status_changed",
"name": "Zendesk Ticket Status Changed",
"description": "Trigger workflow when a ticket status changes in Zendesk"
},
{
"id": "zendesk_ticket_comment_added",
"name": "Zendesk Ticket Comment Added",
"description": "Trigger workflow when a comment is added to a Zendesk ticket"
},
{
"id": "zendesk_ticket_priority_changed",
"name": "Zendesk Ticket Priority Changed",
"description": "Trigger workflow when a ticket priority changes in Zendesk"
},
{
"id": "zendesk_webhook",
"name": "Zendesk Ticket Event",
"description": "Trigger workflow from any Zendesk ticket event"
}
],
"triggerCount": 5,
"authType": "api-key",
"category": "tools",
"integrationType": "support",
Expand Down
105 changes: 105 additions & 0 deletions apps/sim/tools/gitlab/approve_merge_request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import type {
GitLabApproveMergeRequestParams,
GitLabApproveMergeRequestResponse,
} from '@/tools/gitlab/types'
import { getGitLabApiBase } from '@/tools/gitlab/utils'
import type { ToolConfig } from '@/tools/types'

export const gitlabApproveMergeRequestTool: ToolConfig<
GitLabApproveMergeRequestParams,
GitLabApproveMergeRequestResponse
> = {
id: 'gitlab_approve_merge_request',
name: 'GitLab Approve Merge Request',
description: 'Approve a GitLab merge request',
version: '1.0.0',

params: {
accessToken: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'GitLab Personal Access Token',
},
host: {
type: 'string',
required: false,
visibility: 'user-only',
description: 'Self-managed GitLab host (e.g. gitlab.example.com). Defaults to gitlab.com.',
},
projectId: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Project ID or URL-encoded path',
},
mergeRequestIid: {
type: 'number',
required: true,
visibility: 'user-or-llm',
description: 'Merge request internal ID (IID)',
},
sha: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'HEAD SHA of the merge request to approve',
},
},

request: {
url: (params) => {
const encodedId = encodeURIComponent(String(params.projectId).trim())
return `${getGitLabApiBase(params.host)}/projects/${encodedId}/merge_requests/${params.mergeRequestIid}/approve`
},
method: 'POST',
headers: (params) => ({
'Content-Type': 'application/json',
'PRIVATE-TOKEN': params.accessToken,
}),
body: (params) => {
const body: Record<string, unknown> = {}

if (params.sha) body.sha = params.sha

return body
},
},

transformResponse: async (response) => {
if (!response.ok) {
const errorText = await response.text()
return {
success: false,
error: `GitLab API error: ${response.status} ${errorText}`,
output: {},
}
}

const data = await response.json()

return {
success: true,
output: {
approvalsRequired: data.approvals_required ?? null,
approvalsLeft: data.approvals_left ?? null,
approvedBy: data.approved_by ?? [],
},
}
},

outputs: {
approvalsRequired: {
type: 'number',
description: 'Number of approvals required',
},
approvalsLeft: {
type: 'number',
description: 'Number of approvals still needed',
},
approvedBy: {
type: 'array',
description: 'List of approvers',
},
},
}
2 changes: 1 addition & 1 deletion apps/sim/tools/gitlab/cancel_pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const gitlabCancelPipelineTool: ToolConfig<

request: {
url: (params) => {
const encodedId = encodeURIComponent(String(params.projectId))
const encodedId = encodeURIComponent(String(params.projectId).trim())
return `${getGitLabApiBase(params.host)}/projects/${encodedId}/pipelines/${params.pipelineId}/cancel`
},
method: 'POST',
Expand Down
102 changes: 102 additions & 0 deletions apps/sim/tools/gitlab/create_branch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import type { GitLabCreateBranchParams, GitLabCreateBranchResponse } from '@/tools/gitlab/types'
import { getGitLabApiBase } from '@/tools/gitlab/utils'
import type { ToolConfig } from '@/tools/types'

export const gitlabCreateBranchTool: ToolConfig<
GitLabCreateBranchParams,
GitLabCreateBranchResponse
> = {
id: 'gitlab_create_branch',
name: 'GitLab Create Branch',
description: 'Create a new branch in a GitLab project repository',
version: '1.0.0',

params: {
accessToken: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'GitLab Personal Access Token',
},
host: {
type: 'string',
required: false,
visibility: 'user-only',
description: 'Self-managed GitLab host (e.g. gitlab.example.com). Defaults to gitlab.com.',
},
projectId: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Project ID or URL-encoded path',
},
branch: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Name of the new branch',
},
ref: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Source branch/tag/SHA',
},
},

request: {
url: (params) => {
const encodedId = encodeURIComponent(String(params.projectId).trim())
const queryParams = new URLSearchParams()
queryParams.append('branch', String(params.branch))
queryParams.append('ref', String(params.ref))
return `${getGitLabApiBase(params.host)}/projects/${encodedId}/repository/branches?${queryParams.toString()}`
},
method: 'POST',
headers: (params) => ({
'PRIVATE-TOKEN': params.accessToken,
}),
},

transformResponse: async (response) => {
if (!response.ok) {
const errorText = await response.text()
return {
success: false,
error: `GitLab API error: ${response.status} ${errorText}`,
output: {},
}
}

const data = await response.json()

return {
success: true,
output: {
name: data.name ?? null,
webUrl: data.web_url ?? null,
protected: data.protected ?? null,
commit: data.commit ?? null,
},
}
},

outputs: {
name: {
type: 'string',
description: 'The created branch name',
},
webUrl: {
type: 'string',
description: 'The web URL of the branch',
},
protected: {
type: 'boolean',
description: 'Whether the branch is protected',
},
commit: {
type: 'object',
description: 'The commit the branch points to',
},
},
}
Loading
Loading