GitLab API

GitlabTool

Actions905

Overview

This node operation cancels a GitHub import process in a GitLab project by sending a POST request to the GitLab API endpoint `/api/v4/import/github/cancel`. It is useful for users who want to programmatically stop an ongoing GitHub import into GitLab, for example, if the import was started by mistake or needs to be aborted due to errors or changes in requirements.

Use Case Examples

  1. Cancel a GitHub import process in a GitLab project using the GitLab API.
  2. Automate the cancellation of GitHub imports in GitLab projects as part of a CI/CD pipeline.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
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 API request is sent, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to POST for this operation.
Parameter Schema The schema defining the parameters required in the request body for cancelling the GitHub import.
Request Body Schema The schema defining the structure of the request body for the cancel operation.
Request Path The API endpoint path for cancelling the GitHub import, fixed as /api/v4/import/github/cancel.

Output

JSON

  • response - The JSON response from the GitLab API after attempting to cancel the GitHub import.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the GitLab API key credential is valid and has sufficient permissions to cancel imports.
  • Verify the baseUrl is correctly set to the GitLab instance URL if using a self-hosted GitLab.
  • Check that the import process is currently running; cancelling a non-existent or completed import may result in errors.
  • Common error messages may include authentication failures, invalid endpoint errors, or permission denied errors. Verify credentials and API endpoint correctness.

Links

Discussion