GitLab API

GitlabTool

Actions905

Overview

This node operation allows users to post a status to a specific commit in a GitLab project using the GitLab API. It is useful for updating the status of a commit, such as marking it as successful, failed, or pending, which is commonly used in CI/CD pipelines or project status tracking.

Use Case Examples

  1. Updating the status of a commit after running automated tests.
  2. Marking a commit as failed if a build process encounters errors.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used, default is GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Path Parameters Parameters for the API path including project ID and commit SHA.

Output

JSON

  • status - The status of the commit after the update.
  • id - The ID of the status update.
  • sha - The commit hash associated with the status.
  • name - The name of the status context.
  • target_url - URL associated with the status, e.g., link to build logs.
  • description - Description of the status.
  • created_at - Timestamp when the status was created.
  • updated_at - Timestamp when the status was last updated.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and commit SHA are correct and URL-encoded if necessary.
  • Verify that the GitLab API key has sufficient permissions to post commit statuses.
  • Check the base URL if using a self-hosted GitLab instance instead of gitlab.com.
  • Common error: 401 Unauthorized - indicates authentication failure, check API key.
  • Common error: 404 Not Found - indicates the project or commit SHA does not exist or is inaccessible.

Links

Discussion