GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation interacts with the GitLab API to retrieve templates of a specified type for a given project. It is useful for scenarios where you need to fetch project-specific templates such as Dockerfiles, gitignore files, CI/CD configurations, licenses, issues, or merge requests templates. For example, a user can get the Dockerfile template for a project by specifying the project ID and the template type 'dockerfiles'.

Use Case Examples

  1. Fetch the 'gitlab_ci_ymls' template for a project with ID '12345' to automate CI/CD pipeline setup.
  2. Retrieve the 'licenses' template for a project to review or apply licensing information.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public projects or endpoints that do not require authentication.
Authentication Type of authentication used, defaulting to GitLab API key authentication, hidden if skipping authentication is enabled.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET with options for POST, PUT, DELETE, HEAD, PATCH.
Query Parameters Optional query parameters for pagination, including 'page' for current page number and 'per_page' for number of items per page.
Path Parameters Required path parameters including 'id' for the project ID or URL-encoded path, and 'type' for the template type (dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests).

Output

JSON

  • id - The ID or URL-encoded path of the project used in the request
  • type - The type of template requested (e.g., dockerfiles, gitignores)
  • page - Current page number of the results if pagination is used
  • per_page - Number of items per page in the results if pagination is used
  • templateData - The retrieved template data from the GitLab project for the specified type

Dependencies

  • GitLab API key credential for authentication unless skipping authentication is enabled

Troubleshooting

  • Ensure the project ID and template type are correctly specified and URL-encoded if necessary.
  • Verify that the GitLab API key credential is valid and has sufficient permissions to access the project templates.
  • Check the base URL if using a self-hosted GitLab instance instead of gitlab.com.
  • If skipping authentication, confirm the endpoint supports unauthenticated access.
  • Common error messages include 404 Not Found if the project or template type does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion