GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves a specific CI variable from the GitLab API using the variable's key. It is useful for administrators who need to access or manage CI/CD variables in GitLab projects or groups. For example, it can be used to fetch the value or details of a CI variable by specifying its key.

Use Case Examples

  1. Fetching a CI variable named 'DEPLOY_TOKEN' to verify its value before a deployment pipeline.
  2. Retrieving a sensitive CI variable to audit or update its configuration in GitLab.

Properties

Name Meaning
Skip Authentication Determines whether to skip the authentication process for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, defaulting to GET.
Path Parameters The key of the CI variable to retrieve, specified as a path parameter in the API request.

Output

JSON

  • key - The key of the CI variable requested.
  • value - The value of the CI variable.
  • variable_type - The type of the CI variable (e.g., env_var, 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 credentials

Troubleshooting

  • Ensure the provided key exists in the GitLab CI variables; otherwise, the API will return an error indicating the variable was not found.
  • If authentication is enabled, verify that the GitLab API credentials are correct and have sufficient permissions to access admin CI variables.
  • Check the baseUrl to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.

Links

Discussion