GitLab API

GitlabTool

Actions1095

Projects → getApiV4ProjectsIdRepositoryCommitsShaStatuses

AI-generated

Summary

Retrieve the commit status details for a specific commit SHA in a GitLab project, supporting optional filtering and pagination of the status results.

Inputs

  • id (required) — ID or URL-encoded path of the GitLab project.
  • sha (required) — Commit SHA hash for which to retrieve statuses.
  • ref — Optional branch or tag name to filter statuses; defaults to the project's default branch.
  • stage — Filter commit statuses by the build stage.
  • name — Filter commit statuses by job name.
  • pipeline_id — Filter commit statuses by specific pipeline ID.
  • all — Boolean to include all statuses instead of latest only; defaults to false.
  • order_by — Sort commit statuses by 'id' or 'pipeline_id'; defaults to 'id'.
  • sort — Sort order for statuses: 'asc' or 'desc'; defaults to 'asc'.
  • page — Page number for paginated results; defaults to 1.
  • per_page — Number of statuses per page; defaults to 20.

Output shape

a list of commit status objects returned by the GitLab API for the specified commit, optionally filtered and paginated according to inputs

Result is paginated based on 'page' and 'per_page' inputs. If 'all' is false, only latest statuses per job are included; otherwise all statuses are returned. Sorting is controlled by 'order_by' and 'sort' parameters. The shape matches GitLab's /projects/:id/repository/commits/:sha/statuses API response.

Examples

Example 1: Fetch all latest commit statuses for a commit, sorted by ID ascending

Set 'id' and 'sha' for the target project and commit; leave filters default or empty.

Links

Discussion