GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows importing a project into GitLab from a GitHub repository using the GitLab API endpoint `/api/v4/import/github`. It is useful for automating the migration of projects from GitHub to GitLab within workflows, enabling seamless project transfer and integration.

Use Case Examples

  1. Automate importing a GitHub repository into GitLab as part of a CI/CD pipeline setup.
  2. Migrate multiple GitHub projects to GitLab programmatically using n8n workflows.

Properties

Name Meaning
Skip Authentication Determines whether to skip API authentication for the request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication. Hidden if Skip Authentication is true.
baseUrl The base URL of the GitLab instance to which the request is sent, defaulting to https://gitlab.com.
Method HTTP method to use for the request, defaulting to GET but typically POST for this operation.
Parameter Schema Schema defining the parameters required in the request body for the import operation, referencing the postApiV4ImportGithub definition.
Request Body Schema Schema for the request body, if applicable, for the import operation.
Request Path The API endpoint path for importing a GitHub project 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 returned if the import failed.

Dependencies

  • GitLab API key credential for authentication unless Skip Authentication is enabled.

Troubleshooting

  • Ensure the GitLab API key has sufficient permissions to import projects.
  • Verify the GitHub repository URL and access rights are correct and accessible.
  • Check the baseUrl is correctly set to the target GitLab instance.
  • Common errors include authentication failures, invalid request body parameters, or network connectivity issues. Verify the request body matches the expected schema for the import operation.

Links

Discussion