GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves the merge reference information for a specific merge request in a GitLab project using the GitLab API v4. It is useful for developers and DevOps engineers who need to programmatically access details about the merge reference of a merge request, such as for automation scripts, CI/CD pipelines, or integration with other tools.

Use Case Examples

  1. Fetch the merge reference of a merge request to verify the commit SHA before merging.
  2. Use the merge reference data to trigger downstream processes in a CI/CD pipeline based on merge request status.

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 request, default is GET.
Path Parameters Parameters required in the URL path to identify the project and merge request.

Output

JSON

  • id - The unique identifier of the merge request.
  • merge_ref - The merge reference information of the merge request, including commit SHA and branch details.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and merge request IID are correctly provided and URL-encoded if necessary.
  • Verify that the authentication token has sufficient permissions to access the project and merge request data.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 404 Not Found if the project or merge request does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion