GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves the content of a specific blob from a GitLab project's repository using the GitLab API. It is useful for accessing raw file data or other blob objects identified by their SHA commit hash within a project repository. For example, it can be used to fetch the content of a file at a particular commit for analysis or processing.

Use Case Examples

  1. Fetch the content of a file blob from a GitLab project repository by specifying the project ID and the commit SHA.
  2. Retrieve raw data of a repository blob to use in further automation workflows.

Properties

Name Meaning
Skip Authentication Option to skip authentication when making the API request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance to which the API request is sent, default is https://gitlab.com.
Method HTTP method used for the API request, default is GET.
Path Parameters Parameters used in the API request path to specify the project and blob to retrieve.

Output

JSON

  • content - The content of the blob retrieved from the repository.
  • encoding - The encoding format of the blob content, e.g., base64.
  • sha - The SHA commit hash identifying the blob.
  • size - The size of the blob content in bytes.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and commit SHA are correctly specified and URL-encoded if necessary.
  • Verify that the GitLab API key credential has sufficient permissions to access the project repository.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error messages include 404 Not Found if the project or blob does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion