GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node interacts with the GitLab API to create or update CI/CD variables for a specific project. It is useful for automating the management of project-level environment variables in GitLab, which can be used in CI/CD pipelines to store sensitive data or configuration settings. For example, it can be used to programmatically add a new variable to a project before running a pipeline.

Use Case Examples

  1. Automate adding a new CI/CD variable to a GitLab project before pipeline execution.
  2. Update existing project variables to change deployment configurations without manual intervention.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, defaulting to GET but supporting POST, PUT, DELETE, HEAD, and PATCH.
Path Parameters Parameters included in the request path, specifically the project ID or URL-encoded namespace/project name to identify the project.

Output

JSON

  • id - The ID of the project or resource affected.
  • key - The key/name of the CI/CD variable.
  • value - The value assigned to the CI/CD variable.
  • variable_type - The type of the variable (e.g., env_var).
  • protected - Indicates if the variable is protected.
  • masked - Indicates if the variable is masked.
  • environment_scope - The environment scope where the variable is applied.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID or namespace/project name is correctly URL-encoded and valid to avoid 404 errors.
  • Verify that the API key has sufficient permissions to create or update project variables to prevent authorization errors.
  • Check the request body schema matches the expected format for variables to avoid validation errors from the API.

Links

Discussion