GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation retrieves the repository tree of a specific project from the GitLab API (version 4). It is useful for users who want to explore the file and directory structure of a GitLab project repository programmatically. For example, developers can use this to list files in a project branch or tag, optionally recursively, and handle pagination for large repositories.

Use Case Examples

  1. Fetching the root directory tree of a project by its ID.
  2. Retrieving a specific branch or tag's repository tree.
  3. Getting a recursive listing of all files and folders in the repository.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the request (boolean). Defaults to false.
Authentication The authentication method used, hidden unless Skip Authentication is false. Defaults to GitLab API key authentication.
baseUrl The base URL of the GitLab instance. Defaults to https://gitlab.com.
Method HTTP method to use for the request. Defaults to GET.
Query Parameters Collection of optional query parameters to customize the repository tree request, including branch/tag name (ref), path within the repository, recursive flag, pagination options, and page tokens.
Path Parameters Path parameters for the request, specifically the project ID or URL-encoded path.

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • ref - The branch or tag name used to retrieve the repository tree.
  • path - The path within the repository tree requested.
  • recursive - Flag indicating if the tree was retrieved recursively.
  • page - Current page number in the paginated response.
  • per_page - Number of items per page in the response.
  • pagination - Pagination method used in the response.
  • page_token - Token used for keyset pagination.
  • repository_tree - The list of files and directories in the repository tree returned by the API.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID or URL-encoded path is correct and accessible with the provided authentication.
  • Verify that the base URL is correct for the GitLab instance being accessed.
  • Check that the authentication token has sufficient permissions to access the repository tree.
  • If pagination is used, ensure the page and per_page parameters are set correctly to avoid incomplete data.
  • If recursive is true, pagination method 'none' must be used; otherwise, an error may occur.

Links

Discussion