GitLab API

GitlabTool

Actions1000

Overview

This node operation updates a specific CI variable for a GitLab group using the GitLab API. It is useful for automating the management of group-level CI/CD variables, such as updating secrets or configuration values for pipelines. For example, a DevOps engineer can use this node to programmatically update environment variables for a group without manually accessing the GitLab UI.

Use Case Examples

  1. Updating a CI variable 'API_KEY' for a GitLab group with ID '12345' to a new value via the API.
  2. Automating the rotation of secrets stored as group CI variables in GitLab.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated endpoints.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET but PUT is used for this operation.
Path Parameters Parameters for the API path, including the group ID and the variable key to update.

Output

JSON

  • id - The ID of the group whose variable is updated.
  • key - The key/name of the CI variable being updated.
  • value - The new value assigned to the CI variable.
  • variable_type - The type of the variable (e.g., env_var or file).
  • 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 authentication token

Troubleshooting

  • Ensure the group ID and variable key are correctly specified; otherwise, the API will return an error.
  • Authentication errors may occur if the GitLab API token is missing or invalid.
  • HTTP method must be PUT for this operation; using other methods may cause failure.

Links

Discussion