GitLab API

GitlabTool

Actions1000

Overview

This node operation updates a CI variable in GitLab using the Admin API. It is useful for managing CI/CD variables programmatically, such as modifying environment variables for automated pipelines in GitLab projects or groups. For example, an admin can update a secret key or configuration variable without manually accessing the GitLab UI.

Use Case Examples

  1. Updating a CI variable key 'MY_SECRET' with a new value via the GitLab Admin API.
  2. Automating the update of CI variables across multiple GitLab projects for consistent deployment settings.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the request (boolean). Defaults to false.
Authentication The authentication method used, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, defaulting to GET but supporting PUT for this operation.
Parameter Schema Defines the path parameter 'key' which is the key of the CI variable to update, and the request body schema for the update operation.
Request Body Schema Schema for the request body containing the updated CI variable details.
Request Path The API endpoint path for updating the CI variable, with a placeholder for the variable key.
Path Parameters Collection of path parameters, specifically the 'key' of the CI variable to update.

Output

JSON

  • response - The JSON response from the GitLab API after updating the CI variable, containing details of the updated variable.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the 'key' path parameter is correctly set to the CI variable key you want to update; otherwise, the API call will fail.
  • Verify that the GitLab API key credential has sufficient admin permissions to update CI variables via the Admin API.
  • Check the baseUrl is correct for your GitLab instance if using a self-hosted GitLab server.
  • Common error messages include 401 Unauthorized (authentication issues), 404 Not Found (variable key does not exist), and 400 Bad Request (invalid request body). Resolving these involves verifying credentials, variable keys, and request payload formats.

Links

Discussion