GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation retrieves a specific CI/CD variable from a GitLab project using the GitLab API. It is useful for automation workflows that need to access project-specific environment variables, such as deployment scripts or CI/CD pipeline configurations. For example, you can use this node to fetch a variable by its key from a project identified by its ID or namespace/project name.

Use Case Examples

  1. Fetch a CI/CD variable named 'DATABASE_URL' from a project with ID '12345' to use in a deployment workflow.
  2. Retrieve environment-specific variables by filtering with the environment scope parameter.

Properties

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

Output

JSON

  • id - The ID of the project or URL-encoded namespace/project name.
  • key - The key of the CI/CD variable.
  • value - The value of the CI/CD variable.
  • environment_scope - The environment scope of the variable, if specified.
  • protected - Indicates if the variable is protected.
  • masked - Indicates if the variable is masked.
  • variable_type - The type of the variable.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID or namespace/project name and variable key are correctly specified; otherwise, the API will return an error.
  • If authentication is required, verify that the GitLab API key credential is correctly configured and has sufficient permissions to access the project variables.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure it is correct.
  • If filtering by environment scope, ensure the filter value matches the environment scope used in the project variables.

Links

Discussion