GitLab API icon

GitLab API

Gitlab

Actions917

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 the value or details of a CI variable stored in GitLab for configuration or auditing purposes.

Use Case Examples

  1. An admin wants to programmatically get the value of a CI variable named 'DEPLOY_TOKEN' to verify or use it in a deployment pipeline.
  2. A DevOps engineer automates the retrieval of CI variables to sync them with another system or for backup.

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 to which the variable applies.

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 if using a self-hosted GitLab instance to ensure the API endpoint is reachable.
  • Common error messages include 404 Not Found if the variable key does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion