GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation retrieves a specific template from a GitLab project using the GitLab API. It is useful for accessing predefined templates such as Dockerfiles, gitignores, CI/CD configurations, licenses, issues, or merge requests associated with a project. For example, a user can fetch a license template like MIT or a gitignore template for a project to automate project setup or configuration.

Use Case Examples

  1. Fetch the MIT license template for a specific GitLab project to include in the project repository.
  2. Retrieve a gitignore template to apply standard ignore rules for a project.
  3. Get a GitLab CI/CD configuration template to set up automated pipelines for a project.

Properties

Name Meaning
Skip Authentication Option to skip authentication when making the API request.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Query Parameters Optional query parameters to refine the request, including source_template_project_id (project ID where the template is stored), project (project name for placeholder expansion in licenses), and fullname (copyright holder name for licenses).
Path Parameters Required path parameters identifying the project and template: id (project ID or URL-encoded path), type (template type such as dockerfiles, gitignores, licenses, etc.), and name (template key).

Output

JSON

  • templateContent - The content of the requested template retrieved from the GitLab project.

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure the project ID or URL-encoded path is correct to avoid 404 errors.
  • Verify that the template type and name are valid and exist in the project to prevent errors.
  • Check authentication credentials if access is denied or unauthorized errors occur.

Links

Discussion