GitLab API

GitlabTool

Actions905

Overview

This node operation allows importing a remote project into GitLab via the GitLab API. It is useful for automating the import of projects hosted externally by specifying the project URL and desired project settings. Practical examples include migrating projects from other Git hosting services or duplicating projects within GitLab with customized configurations.

Use Case Examples

  1. Import a remote Git repository into a new GitLab project by providing the repository URL and desired project path.
  2. Overwrite an existing project in a specific namespace by enabling the overwrite option during import.
  3. Customize project settings such as enabling/disabling features (issues, wiki, CI/CD), setting access levels, and defining merge request behaviors during the import process.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request (boolean). Defaults to false.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the request is sent. Defaults to https://gitlab.com.
Method The HTTP method used for the request. Defaults to GET but POST is used for this operation.
Parameter Schema Defines the form data parameters for the remote import operation, including required fields like url (project file URL) and path (new project path and name), and optional fields for project customization such as name, namespace, overwrite flag, and numerous override parameters for project features and access levels.
Request Path The API endpoint path for the remote import operation, fixed to /api/v4/projects/remote-import.

Output

JSON

  • id - The unique identifier of the imported project.
  • name - The name of the imported project.
  • path - The path of the imported project.
  • namespace - The namespace under which the project is imported.
  • description - The description of the imported project.
  • visibility - The visibility level of the imported project (private, internal, public).
  • import_status - The status of the import process.
  • created_at - Timestamp when the project was created.
  • last_activity_at - Timestamp of the last activity in the project.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the provided URL is accessible and valid for import; invalid URLs will cause import failure.
  • Check that the authentication credentials have sufficient permissions to create or overwrite projects in the target namespace.
  • If overwrite is enabled, verify that the existing project can be overwritten without conflicts.
  • Review API rate limits and network connectivity issues if requests fail or time out.
  • Validate all override parameters for correct types and allowed values to avoid API errors.

Links

Discussion