GitLab API icon

GitLab API

Gitlab

Actions880

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 for the request, useful for public repositories or testing.
Authentication Type of authentication used, here it is GitLab API authentication, hidden if skipping authentication.
baseUrl 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 for the API path including project ID or URL-encoded path and the commit SHA to identify the blob.

Output

JSON

  • content - The content of the blob retrieved from the repository
  • encoding - Encoding type of the blob content
  • sha - The commit hash used to retrieve the blob
  • size - Size of the blob content in bytes

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure the project ID and commit SHA are correct and URL-encoded if necessary.
  • Authentication errors may occur if the API token is missing or invalid; verify credentials.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure it is correct.
  • HTTP method should be GET for this operation; using other methods may cause errors.

Links

Discussion