GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves the repository tree of a specific project from the GitLab API (v4). 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 branch or tag, navigate project directories, or fetch repository metadata for automation or integration purposes.

Use Case Examples

  1. Fetching the root directory tree of a project to display its files in a custom dashboard.
  2. Recursively retrieving all files and folders in a project repository for backup or analysis.
  3. Paginating through large repository trees to process files in batches.

Properties

Name Meaning
Skip Authentication Whether to skip authentication when making the API request.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to connect to, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to GET.
Parameter Schema Defines the parameters for the API request including project ID, branch/tag reference, path within the repository, recursion flag, pagination options, and page tokens.
Query Parameters Collection of optional query parameters to customize the repository tree request, such as branch reference, path, recursion, pagination, and page tokens.
Path Parameters Collection of path parameters including the project ID or URL-encoded path required to identify the project.

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • ref - The name of the repository branch or tag used to fetch the tree.
  • path - The path within the repository tree to fetch.
  • recursive - Flag indicating if the tree is fetched recursively.
  • page - Current page number for pagination.
  • per_page - Number of items per page for pagination.
  • pagination - Pagination method used (legacy, keyset, or none).
  • page_token - Token for keyset pagination to start from a specific record.

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 credentials are valid and have sufficient permissions to access the project repository.
  • If using pagination, ensure the parameters are correctly set to avoid incomplete or empty results.
  • If recursive fetching is enabled, be aware of potential performance impacts on large repositories.

Links

Discussion