GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation retrieves a specific project template from GitLab using the GitLab API v4. It is useful for fetching predefined templates related to projects, such as Dockerfiles, gitignore files, CI/CD configurations, licenses, issues, or merge requests. For example, a user can get the MIT license template or a specific gitignore template for a project by specifying the project ID, template type, and template name.

Use Case Examples

  1. Fetch the MIT license template for a project with ID 123.
  2. Retrieve a gitignore template named 'Node' for a project identified by its URL-encoded path.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for 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 which the API request is sent.
Method The HTTP method used for the API request, default is GET.
Parameter Schema Defines the required and optional parameters for the API request, including project ID, template type, template name, and optional query parameters like source template project ID, project name, and full name for license placeholders.
Query Parameters Optional query parameters to refine the template retrieval, such as source_template_project_id, project name, and fullname for license templates.
Path Parameters Path parameters specifying the project ID, template type, and template name to identify the exact template to retrieve.

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • type - The type of the template (e.g., dockerfiles, gitignores, licenses).
  • name - The key or name of the template.
  • source_template_project_id - The project ID where the template is stored, useful for disambiguation.
  • project - The project name used for expanding placeholders in license templates.
  • fullname - The full name of the copyright holder used in license templates.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and template name are correctly URL-encoded to avoid 404 errors.
  • Verify that the authentication credentials are valid and have sufficient permissions to access the project templates.
  • Check that the template type is one of the allowed values: dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, or merge_requests.
  • If using optional query parameters, ensure they are correctly formatted and valid for the requested template.

Links

Discussion