GitLab API icon

GitLab API

Gitlab

Actions917

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, enabling secure deployment workflows and continuous integration setups. For example, a DevOps engineer can use this node to programmatically create deploy tokens for different projects to manage access without manual intervention.

Use Case Examples

  1. Automatically create deploy tokens for new projects during CI/CD pipeline setup.
  2. Generate deploy tokens for projects to allow external systems to pull code securely.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication for the request.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API requests are sent, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to GET but set to POST for this operation.
Path Parameters Parameters included in the request path, specifically the project ID or URL-encoded path identifying 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 permissions granted by the deploy token, such as read_repository or write_repository.
  • created_at - Timestamp when the deploy token was created.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible by the authenticated user.
  • Verify that the GitLab API key credential has sufficient permissions to create deploy tokens.
  • Check the baseUrl is correctly set to the GitLab instance URL if using a self-hosted GitLab.
  • Common error messages include 401 Unauthorized (invalid or missing API key), 404 Not Found (project ID does not exist or is inaccessible), and 400 Bad Request (invalid request body or parameters). Resolving these involves verifying credentials, project access, and request formatting.

Links

Discussion