GitLab API

GitlabTool

Actions905

Overview

This node operation creates a deploy token for a specific project in GitLab using the GitLab API. It is useful for automating the generation of deploy tokens that allow read-only or write access to repositories, container registries, or package registries in GitLab projects. For example, it can be used in CI/CD pipelines to securely deploy code or artifacts without exposing user credentials.

Use Case Examples

  1. Creating a deploy token for a project to allow automated deployment scripts to access the repository.
  2. Generating a deploy token to enable read-only access to container registries for a specific project.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication for the API request.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method for the API request, defaulting to GET but set to POST for this operation.
Path Parameters The path parameters for the API request, specifically the project ID or URL-encoded path required to identify the project for which the deploy token is created.

Output

JSON

  • id - The unique identifier of the created deploy token.
  • name - The name of the deploy token.
  • token - The actual deploy token string used for authentication.
  • scopes - The scopes or permissions granted by the deploy token.
  • created_at - Timestamp when the deploy token was created.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID or URL-encoded path is correctly provided in the path parameters; otherwise, the API request will fail.
  • Verify that the GitLab API key credential has sufficient permissions to create deploy tokens for the specified project.
  • If skipping authentication, the request may be rejected by the GitLab API due to lack of credentials.

Links

Discussion