GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves the pipelines associated with a specific merge request in a GitLab project using the GitLab API v4. It is useful for developers and DevOps engineers who want to monitor the CI/CD pipeline status of merge requests programmatically. For example, it can be used to automate checks on pipeline results before merging code changes.

Use Case Examples

  1. Fetch all pipelines for merge request IID 42 in project with ID 'my-group/my-project' to verify build status before merging.
  2. Automate notifications based on pipeline results of a merge request in a GitLab project.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, typically an API key credential.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the API request, default is GET.
Path Parameters Parameters to specify the project ID or URL-encoded path and the merge request IID to identify the merge request whose pipelines are to be fetched.

Output

JSON

  • ``
    • id - The unique identifier of each pipeline.
    • status - The status of each pipeline (e.g., running, success, failed).
    • ref - The branch or tag name the pipeline is associated with.
    • sha - The commit SHA the pipeline is running for.
    • web_url - The URL to view the pipeline in GitLab.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and merge request IID are correctly specified and exist in the GitLab instance.
  • Verify that the authentication token has sufficient permissions to access the project's merge request pipelines.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 404 Not Found if the project or merge request does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion