GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation interacts with the GitLab API to perform a CI lint check on a specific project. It is useful for validating the CI/CD configuration of a project by simulating pipeline creation or performing static checks without actually running the pipeline. This helps developers ensure their CI configurations are correct before committing changes. For example, it can be used to verify the syntax and structure of .gitlab-ci.yml files or to simulate pipeline jobs that would be created for a given commit or branch.

Use Case Examples

  1. Validate the CI configuration of a project before merging changes.
  2. Simulate pipeline creation to see which jobs would run for a specific commit or branch.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, defaulting to GET.
Query Parameters Optional query parameters to customize the CI lint request, including sha, content_ref, dry_run, include_jobs, ref, and dry_run_ref.
Path Parameters Path parameter specifying the project ID for which the CI lint check is performed.

Output

JSON

  • status - Status of the CI lint check (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 a pipeline simulation, included if include_jobs is true.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID path parameter is correctly set and corresponds to an existing project in GitLab.
  • Verify that the baseUrl is correct and accessible, especially if using a self-hosted GitLab instance.
  • If authentication is required, ensure the GitLab API key credential is valid and has sufficient permissions to access the project and perform CI lint checks.
  • Common error messages may include 404 Not Found if the project ID is invalid, 401 Unauthorized if authentication fails, or 400 Bad Request if query parameters are malformed.

Links

Discussion