GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows creating deploy tokens for a specific project in GitLab via the GitLab API. It is useful for automating the management of deploy tokens, which are used to authenticate and authorize deployments in CI/CD pipelines or other automated workflows. For example, a user can create a deploy token for a project to enable secure access to the project's repository during deployment.

Use Case Examples

  1. Creating a deploy token for a project to enable automated deployment access.
  2. Automating the creation of deploy tokens as part of a CI/CD pipeline setup.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request.
Authentication Type of authentication 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 HTTP method to use for the API request, defaulting to GET but can be set to POST for this operation.
Path Parameters Parameters to be included in the request path, specifically the project ID or URL-encoded path 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.
  • username - The username associated with the deploy token.
  • token - The actual deploy token string used for authentication.
  • expires_at - The expiration date of the deploy token.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible by the authenticated user.
  • Verify that the authentication credentials (GitLab API key) are valid and have sufficient permissions to create deploy tokens.
  • Check the base URL to ensure it points to the correct GitLab instance if using a self-hosted GitLab server.
  • Common error messages include 401 Unauthorized (invalid or missing authentication), 404 Not Found (project ID does not exist or is inaccessible), and 400 Bad Request (invalid parameters). Resolving these involves correcting credentials, project ID, or request parameters.

Links

Discussion