GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows users to perform a POST request to the GitLab API endpoint `/api/v4/projects/{id}/ci/lint`. It is used to validate a GitLab CI/CD configuration file for a specific project by its ID. This is beneficial for developers and DevOps engineers who want to programmatically check the correctness of their CI/CD pipeline configurations before committing or deploying them.

Use Case Examples

  1. Validate a GitLab CI configuration file for project ID 123 to ensure it is syntactically correct and will run as expected.
  2. Automate CI/CD pipeline validation as part of a larger workflow to catch errors early in the development process.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request, useful for public or unauthenticated endpoints.
Authentication Select the authentication method to use for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET but POST is used for this operation.
Path Parameters Parameters to be included in the request path, specifically the project ID to identify which project's CI configuration to lint.

Output

JSON

  • status - HTTP response status code indicating the result of the lint operation.
  • data
    • valid - Boolean indicating if the CI configuration is valid.
    • errors - List of errors found in the CI configuration if invalid.
    • warnings - List of warnings related to the CI configuration.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the provided authentication.
  • Verify that the base URL is correct and points to a valid GitLab instance.
  • If authentication is skipped, confirm that the endpoint supports unauthenticated access, otherwise authentication errors will occur.
  • Check the request body format matches the expected schema for the CI linting API to avoid validation errors.

Links

Discussion