GitLab API

GitlabTool

Actions905

Overview

This node operation allows users to create a deploy key for a specific project in GitLab via the GitLab API. It is useful for automating the addition of SSH deploy keys to projects, enabling secure and automated access to repositories for deployment or CI/CD pipelines. For example, a DevOps engineer can use this node to programmatically add deploy keys to multiple projects to streamline deployment processes.

Use Case Examples

  1. Automate adding deploy keys to GitLab projects for continuous deployment.
  2. Securely manage SSH keys for multiple projects without manual intervention.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used, default is GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Path Parameters Parameters to be included in the request path, specifically the project ID or URL-encoded path.

Output

JSON

  • id - ID of the created deploy key.
  • title - Title of the deploy key.
  • key - The SSH key content.
  • created_at - Timestamp when the deploy key was created.
  • can_push - Boolean indicating if the deploy key has write access.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID provided in path parameters is correct and accessible by the authenticated user.
  • Verify that the GitLab API key credential has sufficient permissions to add deploy keys to the project.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error: 401 Unauthorized - indicates authentication failure; verify API key and authentication settings.
  • Common error: 404 Not Found - indicates the project ID does not exist or is not accessible.

Links

Discussion