GitLab API icon

GitLab API

Gitlab

Actions1062

Commits → getApiV4ProjectsIdRepositoryCommitsShaMergeRequests

AI-generated

Summary

Retrieve the merge requests associated with a specific commit (by commit SHA, branch, or tag) in a GitLab project via the GitLab API.

Inputs

  • id (required) — The ID or URL-encoded path of the GitLab project to query.
  • sha (required) — The commit SHA, branch name, or tag name to find associated merge requests for.
  • page — The page number to retrieve in the paginated response (optional). Defaults to 1 if not specified.
  • per_page — The number of merge request items per page in the paginated response (optional). Defaults to 20 if not specified.

Output shape

a paginated list of merge requests linked to the specified commit

The results are paginated and can be controlled using the 'page' and 'per_page' query parameters. Authentication is required unless 'Skip Authentication' is enabled. The base URL defaults to https://gitlab.com but can be customized.

Examples

Example 1: Retrieve first page of merge requests for commit SHA 'abc123' in project with ID 'my-group/my-project'

Set Path Parameters id to 'my-group/my-project' and sha to 'abc123'. Optionally specify page and per_page under Query Parameters.

Links

Discussion