GitLab API

GitlabTool

Actions1000

Overview

This node operation allows users to create a remote mirror for a specific project in GitLab by sending a POST request to the GitLab API endpoint `/api/v4/projects/{id}/remote_mirrors`. It is useful for automating the setup of remote mirrors for project repositories, enabling synchronization with remote Git repositories.

Use Case Examples

  1. Automatically create a remote mirror for a GitLab project after project creation.
  2. Set up remote mirrors for backup or synchronization purposes in a CI/CD pipeline.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The 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.

Output

JSON

  • id - The ID of the created remote mirror.
  • url - The URL of the remote mirror repository.
  • enabled - Indicates if the remote mirror is enabled.
  • only_protected_branches - Indicates if only protected branches are mirrored.
  • keep_divergent_refs - Indicates if divergent refs are kept.
  • created_at - Timestamp when the remote mirror was created.
  • updated_at - Timestamp when the remote mirror was last updated.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible.
  • Verify that the authentication credentials (GitLab API key) are valid and have sufficient permissions to create remote mirrors.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error messages include 401 Unauthorized (invalid or missing authentication), 404 Not Found (invalid project ID), and 400 Bad Request (invalid request body). Resolving these involves correcting credentials, project ID, or request payload.

Links

Discussion