GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves a specific GitLab CI/CD variable by its key from the GitLab Admin API (v4). It is useful for administrators or automation workflows that need to fetch configuration variables used in GitLab CI pipelines, for example, to verify or audit CI variables programmatically.

Use Case Examples

  1. Fetch a CI variable by its key to check its value before running a deployment pipeline.
  2. Automate the retrieval of CI variables for backup or synchronization purposes across GitLab instances.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication for the request.
Authentication The authentication method used for the request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to GET.
Path Parameters The path parameters for the API request, specifically the 'key' of the CI variable to retrieve.

Output

JSON

  • key - The key of the CI variable requested.
  • value - The value of the CI variable retrieved from GitLab.
  • variable_type - The type of the CI 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 'key' path parameter is correctly set and matches an existing CI variable key in GitLab.
  • If authentication is enabled, verify that the GitLab API key credential is valid and has 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.
  • Common errors include 404 Not Found if the variable key does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion