GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves the raw content of a specific file from a GitLab project's repository. It is useful for scenarios where you need to access the exact file data, such as fetching source code files, configuration files, or any other repository content directly. For example, developers can use this to automate the retrieval of project files for analysis or deployment.

Use Case Examples

  1. Fetch the raw content of a README.md file from a GitLab project repository.
  2. Retrieve a configuration file from a specific branch or commit in a GitLab project.

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 The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method used for the request, defaulting to GET.
Query Parameters Optional query parameters for the request, including 'ref' to specify the branch, tag, or commit, and 'lfs' to indicate if the file is a large file storage pointer.
Path Parameters Required path parameters specifying the project ID and the URL-encoded file path within the repository.

Output

JSON

  • fileContent - Raw content of the requested file from the GitLab project repository.

Dependencies

  • GitLab API key credential for authentication.

Troubleshooting

  • Ensure the project ID and file path are correctly URL-encoded and valid to avoid 404 errors.
  • Check authentication credentials if access is denied or unauthorized errors occur.
  • Verify the 'ref' query parameter if the file is not found in the default branch.

Links

Discussion