GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation retrieves the raw content of a specific file from a GitLab project's repository using the GitLab API v4. It is useful for scenarios where you need to access the exact file content stored in a repository, such as fetching configuration files, scripts, or any source code files directly from a GitLab project. For example, it can be used to automate the retrieval of a README file or any other file for processing or analysis in an automation workflow.

Use Case Examples

  1. Fetch the raw content of a README.md file from a specific branch of a GitLab project.
  2. Retrieve a binary file stored in Git LFS from a repository for further processing.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request (boolean). Useful for public repositories or when authentication is not required.
Authentication The authentication method used for the API request, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the request, default is GET.
Parameter Schema Defines the required and optional parameters for the API call, including project ID, file path, branch/tag/commit reference, and LFS flag.
Query Parameters Optional query parameters such as 'ref' for branch/tag/commit name and 'lfs' to indicate if the file is a Git LFS pointer.
Path Parameters Path parameters including 'id' for the project ID and 'file_path' for the URL-encoded path to the file in the repository.

Output

JSON

  • fileContent - The raw content of the requested file from the GitLab repository.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and file path are correctly URL-encoded and valid.
  • Verify that the specified branch, tag, or commit reference exists in the repository.
  • Check that the authentication credentials have sufficient permissions to access the project and repository files.
  • If retrieving LFS files, ensure the 'lfs' query parameter is correctly set to true to get binary data.

Links

Discussion