GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node interacts with the GitLab API, specifically supporting the operation to post a CI lint request to a project. It is useful for validating GitLab CI/CD configuration files by sending them to the GitLab server for linting. This helps developers ensure their CI/CD pipelines are correctly configured before running them, preventing pipeline failures due to syntax or configuration errors.

Use Case Examples

  1. A developer wants to validate their .gitlab-ci.yml file for a specific project by sending it to the GitLab CI Lint API endpoint to check for errors.
  2. An automation workflow triggers a CI lint check on a GitLab project whenever a new pipeline configuration is pushed, ensuring the configuration is valid before execution.

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 requests are sent, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to GET but supporting POST, PUT, DELETE, HEAD, and PATCH.
Path Parameters The path parameters for the API request, specifically the project ID required for the CI lint endpoint.

Output

JSON

  • lint_status - The status of the CI lint validation (e.g., valid or invalid).
  • errors - Any errors found in the CI configuration during linting.
  • warnings - Any warnings generated during the linting process.
  • merged_yaml - The merged YAML configuration after processing includes and extends.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID path parameter is correctly provided and is a valid project identifier in GitLab.
  • Verify that the authentication credentials (GitLab API key) are correctly configured and have sufficient permissions to access the project.
  • Check the baseUrl to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages may include authentication failures, invalid project ID, or malformed CI configuration errors returned from the GitLab API. Resolving these involves correcting credentials, verifying project existence, and fixing CI YAML syntax respectively.

Links

Discussion