GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves the statuses of a specific commit in a GitLab project repository. It is useful for monitoring the state of CI/CD pipelines, build stages, or jobs associated with a commit. For example, developers can use it to check if all tests passed or if a deployment stage succeeded for a particular commit SHA.

Use Case Examples

  1. Get the latest pipeline statuses for a commit to verify build success.
  2. Filter commit statuses by job name or build stage to diagnose specific pipeline steps.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the request.
Authentication The authentication method used, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Parameter Schema Defines the path and query parameters for the API call, including project ID, commit SHA, and optional filters like branch name, build stage, job name, pipeline ID, pagination, and sorting options.
Query Parameters Collection of optional query parameters to filter and sort commit statuses, such as ref (branch/tag), stage, name, pipeline_id, all (include all statuses), order_by, sort, page, and per_page.
Path Parameters Collection of required path parameters: project ID and commit SHA to identify the commit whose statuses are retrieved.

Output

JSON

  • id - Unique identifier of the commit status.
  • sha - Commit SHA hash.
  • ref - Branch or tag name associated with the commit.
  • status - Status of the commit (e.g., success, failed, running).
  • name - Name of the job or pipeline stage.
  • stage - Build stage name.
  • created_at - Timestamp when the status was created.
  • started_at - Timestamp when the job started.
  • finished_at - Timestamp when the job finished.
  • allow_failure - Indicates if the failure of this job is allowed.
  • author - Information about the user who triggered the status.
  • pipeline_id - ID of the pipeline associated with the status.

Dependencies

  • Requires GitLab API authentication credentials (API key or token).

Troubleshooting

  • Ensure the project ID and commit SHA are correctly URL-encoded and valid to avoid 404 errors.
  • Check that the authentication token has sufficient permissions to access the project repository and commit statuses.
  • If filtering parameters are used, verify their correctness to avoid empty or unexpected results.
  • Pagination parameters should be set properly to handle large result sets without missing data.

Links

Discussion