GitLab API

GitlabTool

Actions905

Overview

This node operation allows users to import a GitHub repository into GitLab using the GitLab API endpoint `/api/v4/import/github`. It supports making a POST request to initiate the import process. This is useful for automating the migration of projects from GitHub to GitLab within an n8n workflow.

Use Case Examples

  1. Automate importing a GitHub repository into GitLab when a new project is created on GitHub.
  2. Migrate multiple GitHub repositories to GitLab programmatically using n8n workflows.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication for the API request.
Authentication The authentication method to use for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the request is sent, default is https://gitlab.com.
Method The HTTP method to use for the request, default is POST for this operation.
Parameter Schema Defines the schema for the parameters sent in the request body for the import operation.
Request Body Schema Schema for the request body, typically containing details about the GitHub repository to import.
Request Path The API endpoint path for importing a GitHub repository into GitLab, fixed as /api/v4/import/github.

Output

JSON

  • id - The unique identifier of the imported project in GitLab.
  • name - The name of the imported project.
  • path - The path or URL slug of the imported project.
  • import_status - The status of the import process (e.g., 'started', 'finished', 'failed').
  • import_error - Any error message related to the import process if it failed.

Dependencies

  • Requires GitLab API key credential for authentication unless skipping authentication.

Troubleshooting

  • If authentication fails, ensure the GitLab API key is valid and has sufficient permissions to import projects.
  • If the import fails, check the import_error field in the output for details.
  • Ensure the baseUrl is correctly set to the GitLab instance URL if using a self-hosted GitLab server.

Discussion