GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation updates a specific variable in a GitLab group using the GitLab API. It is useful for automating the management of group-level CI/CD variables, allowing users to programmatically modify variable values or attributes within a group. For example, it can be used to update environment variables for deployment pipelines in GitLab groups.

Use Case Examples

  1. Updating a CI/CD variable's value in a GitLab group to change deployment settings.
  2. Modifying a secret variable in a GitLab group to rotate credentials automatically.

Properties

Name Meaning
Skip Authentication Option to bypass authentication for the request.
Authentication Type of authentication used, defaulting to GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but for this operation it is PUT.
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 where the variable is updated.
  • key - The key of the variable updated.
  • value - The new value of the variable.
  • variable_type - The type of the variable (e.g., env_var).
  • protected - Whether the variable is protected.
  • masked - Whether the variable is masked.
  • environment_scope - The environment scope the variable applies to.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the group ID and variable key are correctly specified and URL-encoded if necessary.
  • Verify that the API key has sufficient permissions to update group variables.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common errors include 404 Not Found if the group or variable key does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion