GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation retrieves a specific variable from a GitLab project using the GitLab API v4. It is useful for automating workflows that require accessing project-level variables, such as CI/CD environment variables, configuration settings, or secrets stored in GitLab projects. For example, it can be used to fetch a deployment key or environment-specific variable for use in subsequent automation steps.

Use Case Examples

  1. Fetch a CI/CD variable by its key from a GitLab project to use in a deployment pipeline.
  2. Retrieve environment-specific configuration variables for a project to dynamically adjust automation behavior.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public endpoints or testing.
Authentication Type of authentication used, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Query Parameters Optional query parameters for the request, including environment scope filter.
Path Parameters Required path parameters identifying the project and variable key.

Output

JSON

  • id - ID or URL-encoded namespace/project name of the GitLab project
  • key - Key of the variable retrieved
  • value - Value of the variable
  • environment_scope - Environment scope of the variable, if any
  • protected - Indicates if the variable is protected
  • masked - Indicates if the variable is masked
  • variable_type - Type of the variable (e.g., env_var)

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and variable key are correct and URL-encoded if necessary.
  • Check that the API key has sufficient permissions to access project variables.
  • If using environment scope filter, verify the scope string matches exactly.
  • Common errors include 404 Not Found if the project or variable does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion