GitLab API

GitlabTool

Actions905

Overview

This node operation performs a POST request to the GitLab API endpoint `/api/v4/projects/{id}/ci/lint`. It is used to trigger a CI linting process for a specific project identified by its ID. This operation is beneficial for developers and DevOps engineers who want to validate their CI/CD pipeline configuration in GitLab programmatically, ensuring that the `.gitlab-ci.yml` file is syntactically correct before running the pipeline.

Use Case Examples

  1. A developer wants to automate the validation of their GitLab CI configuration file as part of a CI/CD workflow.
  2. A DevOps engineer integrates this node in an n8n workflow to lint multiple project pipelines in GitLab to catch configuration errors early.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication for the API request.
Authentication The authentication method used for the API request, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance to which the API request is sent, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, default is POST for this operation.
Path Parameters The path parameters for the API request, specifically the project ID to identify which project's CI configuration to lint.

Output

JSON

  • status - The status of the linting operation, indicating success or failure.
  • errors - Any errors found in the CI configuration during linting.
  • warnings - Warnings related to the CI configuration that do not block the pipeline but should be reviewed.
  • merged_yaml - The merged YAML configuration after processing includes and extends in the CI file.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID path parameter is correctly set and corresponds to an existing project in GitLab.
  • Verify that the API key credential has sufficient permissions to access the project's CI lint endpoint.
  • If skipping authentication, the request may fail due to lack of authorization.
  • Check the baseUrl is correctly set to the GitLab instance URL if using a self-hosted GitLab server.

Links

Discussion