GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves a specific CI/CD variable from a GitLab group using the GitLab API. It is useful for automation workflows that need to access or manage group-level CI/CD variables programmatically, such as fetching environment-specific secrets or configuration values stored in GitLab groups.

Use Case Examples

  1. Fetch a CI/CD variable named 'DEPLOY_TOKEN' from a GitLab group with ID '12345' to use in a deployment pipeline.
  2. Retrieve a sensitive API key stored as a group variable to pass it securely to another service during a CI/CD process.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated API calls.
Authentication Type of authentication used for the API request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method used for the API request, defaulting to GET.
Path Parameters Parameters to specify the group ID and the variable key to retrieve.

Output

JSON

  • id - The ID or URL-encoded path of the GitLab group.
  • key - The key of the CI/CD variable.
  • value - The value of the CI/CD variable retrieved from the group.
  • variable_details - Additional details about the variable such as environment scope, protected status, and variable type.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the group ID and variable key are correctly specified and URL-encoded if necessary.
  • Verify that the API key used has sufficient permissions to access group variables.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error messages include 404 Not Found if the group or variable does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion