GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation triggers a pipeline for a specific merge request in a GitLab project using the GitLab API. It is useful for automating CI/CD workflows by programmatically starting pipelines on merge requests, for example, to run tests or deployments when a merge request is created or updated.

Use Case Examples

  1. Trigger a pipeline for a merge request in a GitLab project to automate testing before merging code changes.
  2. Automatically start a deployment pipeline when a merge request reaches a certain stage.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the API request, default is GET but POST is used for this operation.
Path Parameters Parameters required in the API path to identify the project and merge request.

Output

JSON

  • id - The unique identifier of the triggered pipeline.
  • status - The current status of the pipeline (e.g., running, pending, success).
  • ref - The branch or tag name the pipeline is running against.
  • sha - The commit SHA the pipeline is associated with.
  • web_url - The URL to view the pipeline in the GitLab web interface.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and merge request IID are correct and exist in the GitLab instance.
  • Verify that the API key has sufficient permissions to trigger pipelines on the project.
  • Check the base URL is correct if using a self-hosted GitLab instance.
  • Common error: 401 Unauthorized - indicates authentication failure; verify API key and authentication settings.
  • Common error: 404 Not Found - indicates the project or merge request does not exist or is inaccessible.

Links

Discussion