GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation retrieves templates of a specified type for a given project from the GitLab API. It is useful for users who want to access predefined templates related to Dockerfiles, gitignores, GitLab CI YAMLs, licenses, issues, or merge requests within a specific project. For example, a user can fetch all license templates available for a project to automate license selection or review.

Use Case Examples

  1. Fetch Dockerfile templates for a project to automate container setup.
  2. Retrieve gitignore templates to apply standard ignore rules in a project.
  3. Get GitLab CI YAML templates to configure CI/CD pipelines automatically.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request.
baseUrl The base URL of the GitLab instance to send the API request to.
Method The HTTP method used for the API request.
Parameter Schema Defines the required and optional parameters for the API request, including project ID, template type, pagination page, and items per page.
Request Body Schema Schema for the request body, if applicable (null for this operation).
Request Path The API endpoint path with placeholders for project ID and template type.
Query Parameters Optional query parameters for pagination: page number and items per page.
Path Parameters Path parameters specifying the project ID and template type to fetch.

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • type - The type of the template (dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests).
  • page - Current page number of the results.
  • per_page - Number of items per page in the results.
  • templates - List of templates returned by the API for the specified project and type.

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure the project ID and template type are correctly specified and URL-encoded if necessary.
  • Verify that the authentication credentials are valid and have sufficient permissions to access the project templates.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • If pagination parameters are used, ensure they are valid integers and within allowed ranges.

Links

Discussion