GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows users to create a deploy key for a specific project in GitLab by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/deploy_keys`. It is useful for automating the management of deploy keys in GitLab projects, enabling secure SSH access for deployment purposes without manual intervention. For example, a DevOps engineer can use this node to programmatically add deploy keys to multiple projects as part of a CI/CD pipeline setup.

Use Case Examples

  1. Automate adding deploy keys to GitLab projects during CI/CD pipeline setup.
  2. Manage deploy keys across multiple projects programmatically to ensure consistent access control.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request.
Authentication Select the authentication method to use for the API request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance to which the API request is sent, defaulting to https://gitlab.com.
Method HTTP method used for the API request, defaulting to GET but set to POST for this operation.
Path Parameters Parameters included in the API request path, specifically the project ID or URL-encoded path identifying the project to which the deploy key will be added.

Output

JSON

  • id - The unique identifier of the created deploy key.
  • title - The title of the deploy key.
  • key - The SSH key content of the deploy key.
  • created_at - Timestamp when the deploy key was created.
  • can_push - Boolean indicating if the deploy key has write access.
  • fingerprint - The fingerprint of the deploy key for identification.

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 API key used has sufficient permissions to add deploy keys to the project.
  • Check the format and validity of the SSH key provided in the request body to avoid rejection by the GitLab API.
  • Common error messages include authentication failures, permission denied errors, and invalid parameter errors. Resolving these typically involves verifying credentials, permissions, and input data formats.

Links

Discussion