GitLab API

GitlabTool

Actions1000

Overview

This node interacts with the GitLab API to perform a CI lint operation on a specific project. It sends a POST request to the endpoint `/api/v4/projects/{id}/ci/lint` to validate the CI/CD configuration of the project identified by the given project ID. This is useful for developers and DevOps engineers who want to programmatically check the correctness of their GitLab CI configuration before committing changes, ensuring that the pipeline will run without errors.

Use Case Examples

  1. A developer uses this node to validate the `.gitlab-ci.yml` file of a project before pushing changes to the repository.
  2. A CI/CD automation workflow includes this node to automatically lint the CI configuration after updates, preventing broken pipelines.

Properties

Name Meaning
Skip Authentication Option to skip authentication when making the API request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method used for the request, defaulting to GET but can be set to POST, PUT, DELETE, HEAD, or PATCH.
Path Parameters Collection of path parameters required for the API endpoint, specifically the project ID to identify which project's CI configuration to lint.

Output

JSON

  • status - The status of the CI lint operation, indicating success or failure.
  • errors - List of errors found in the CI configuration if the linting failed.
  • warnings - List of warnings related to the CI configuration.
  • valid - Boolean indicating whether the CI configuration is valid.

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 authentication credentials (GitLab API key) are valid and have sufficient permissions to access the project.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages may include authentication failures, project not found, or invalid CI configuration syntax. Resolving these involves correcting credentials, verifying project existence, and fixing CI YAML syntax errors.

Links

Discussion