GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows creating 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 external repositories.

Use Case Examples

  1. Automatically create a remote mirror for a GitLab project to keep it synchronized with an external repository.
  2. Set up remote mirrors for multiple projects in GitLab via workflow automation to streamline repository management.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET but POST is used 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.
  • 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.

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible.
  • Verify that the authentication credentials 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 (authentication failure), 404 Not Found (invalid project ID), and 400 Bad Request (invalid request body). Resolving these involves correcting credentials, project ID, or request data.

Links

Discussion