GitLab API

GitlabTool

Actions1000

Overview

This node operation allows creating deploy tokens for a specific project in GitLab via the GitLab API. It is useful for automating the generation of deploy tokens that can be used for accessing repositories or container registries securely without using personal credentials. For example, a DevOps engineer can use this node to programmatically create deploy tokens for CI/CD pipelines or deployment automation.

Use Case Examples

  1. Creating a deploy token for a project to allow automated deployment scripts to access the repository.
  2. Automating the creation of deploy tokens for multiple projects to streamline access management.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated API calls.
Authentication Specifies the authentication method to use, 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 HTTP method to use for the API request, defaulting to GET but here it should be POST for creating deploy tokens.
Path Parameters Parameters to be included in the API request path, specifically the project ID or URL-encoded path 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 to the deploy token.
  • created_at - Timestamp when the deploy token was created.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID or URL-encoded path is correct and accessible by the authenticated user to avoid 404 or permission errors.
  • Verify that the authentication credentials are valid and have sufficient permissions to create deploy tokens.
  • Check that the HTTP method is set to POST for creating deploy tokens; using GET or other methods will not work.
  • If skipping authentication, ensure the GitLab instance allows unauthenticated deploy token creation, which is uncommon.

Links

Discussion