GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves the repository tree of a specific project from the GitLab API (version 4). It is useful for scenarios where you need to explore or list the files and directories within a GitLab project repository, such as for automation scripts, CI/CD pipelines, or project analysis tools. For example, you can get the file structure of a project branch or tag, optionally recursively, and paginate through large trees.

Use Case Examples

  1. Retrieve the root directory tree of a project with ID '1' on the default branch.
  2. Get the repository tree of a specific branch or tag by specifying the 'ref' parameter.
  3. Fetch the entire repository tree recursively to analyze all files and folders.

Properties

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

Output

JSON

  • id - The project ID or URL-encoded path used in the request.
  • repositoryTree - The list of files and directories in the project's repository tree returned by the API.

Dependencies

  • GitLab API key credential for authentication (unless skipping authentication).

Troubleshooting

  • Ensure the project ID or path is correct and URL-encoded if necessary to avoid 404 errors.
  • Verify authentication credentials if not skipping authentication to prevent authorization errors.
  • Check the base URL if using a self-hosted GitLab instance to avoid connection issues.
  • Pagination parameters must be valid integers or strings as expected by the API to avoid request errors.

Links

Discussion