GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves the content of a specific blob (file) from a GitLab project's repository using the commit hash (SHA). It is useful for accessing the exact state of a file at a particular commit in a GitLab project. For example, developers can use this to fetch source code files or configuration files from a specific commit for analysis or deployment.

Use Case Examples

  1. Fetch the content of a file from a GitLab project repository at a specific commit SHA to verify code changes.
  2. Retrieve a configuration file blob from a project to use in a CI/CD pipeline.

Properties

Name Meaning
Skip Authentication Option to skip authentication when making the API request.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Path Parameters Parameters to specify the project ID or URL-encoded path and the commit SHA to identify the blob.

Output

JSON

  • content - The content of the blob (file) retrieved from the repository.
  • encoding - The encoding format of the blob content, e.g., base64.
  • id - The blob ID.
  • sha - The commit hash associated with the blob.

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure the project ID and commit SHA are correct and URL-encoded if necessary.
  • Verify that the authentication token has sufficient permissions to access the project repository.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.

Links

Discussion