GitLab API

GitlabTool

Actions1095

Projects → getApiV4ProjectsIdPipelinesLatest

AI-generated

Summary

Retrieve the latest pipeline for a specified GitLab project, optionally filtered by a branch reference.

Inputs

  • Id (required) — The project ID or URL-encoded path identifying the GitLab project to retrieve the pipeline from.
  • Ref — The branch reference name to filter the latest pipeline. Defaults to the project's default branch if not specified.
  • Skip Authentication — Whether to skip authentication. Defaults to false, requiring authentication via GitLab API credentials.

Output shape

a single JSON object representing the latest pipeline for the given project and optional branch reference

Returns the pipeline object retrieved from the GitLab API endpoint /api/v4/projects/{id}/pipelines/latest. If the 'ref' parameter is provided, it filters the pipeline for that branch; otherwise, it returns the pipeline from the project’s default branch.

Examples

Example 1: Get the latest pipeline for project with ID '1234' using the default branch

Set 'Id' to '1234' and leave 'Ref' empty or unset.

Example 2: Get the latest pipeline for project with ID '1234' on branch 'develop'

Set 'Id' to '1234' and 'Ref' to 'develop'.

Links

Discussion