GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node interacts with the GitLab API to perform CI linting on a specific project. It is useful for validating GitLab CI/CD configuration files before running pipelines, helping to catch syntax errors or misconfigurations early. For example, a user can specify a project ID and provide a commit SHA or branch reference to simulate or statically check the CI configuration.

Use Case Examples

  1. Validate the CI configuration of a project at a specific commit SHA to ensure no syntax errors before pipeline execution.
  2. Run a dry run simulation of the pipeline creation to preview jobs that would be created without actually running the pipeline.

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.
Method The HTTP method used for the API request (GET, POST, PUT, DELETE, HEAD, PATCH).
Query Parameters Optional query parameters to customize the CI lint request, such as commit SHA, content reference, dry run flag, inclusion of jobs, and branch/tag references.
Path Parameters Path parameters including the project ID for which the CI linting is performed.

Output

JSON

  • lint_status - The status of the CI lint validation (e.g., valid or invalid).
  • errors - List of errors found in the CI configuration, if any.
  • warnings - List of warnings found in the CI configuration, if any.
  • jobs - List of jobs that would be created in the pipeline simulation, if requested.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID is correct and accessible with the provided authentication token.
  • Check that the base URL is correctly set to the GitLab instance URL if using a self-hosted GitLab.
  • If using dry run or content_ref parameters, verify they are valid commit SHAs, branches, or tags in the project.
  • Authentication errors may occur if the API key is missing, expired, or lacks necessary permissions.

Links

Discussion