GitLab API

GitlabTool

Actions905

Overview

This node operation allows sharing a GitLab project with a user or group by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/share`. It is useful for automating project sharing tasks in GitLab, such as granting access permissions to collaborators programmatically.

Use Case Examples

  1. Automatically share a GitLab project with a new team member by specifying the project ID and sharing details.
  2. Integrate project sharing into a CI/CD pipeline to manage access control dynamically.

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 request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, defaulting to POST for this operation.
Path Parameters The path parameters for the API request, specifically the project ID or URL-encoded path to identify the project to share.

Output

JSON

  • id - The ID of the project being shared.
  • group_id - The ID of the group with which the project is shared.
  • group_name - The name of the group with which the project is shared.
  • access_level - The access level granted to the group or user for the project.
  • expires_at - The expiration date of the share access, if set.

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 authentication credentials (GitLab API key) are valid and have sufficient permissions to share the project.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 401 Unauthorized (invalid or missing authentication), 404 Not Found (project ID does not exist), and 403 Forbidden (insufficient permissions). Resolving these involves verifying credentials, project existence, and user permissions.

Links

Discussion