GitLab API

GitlabTool

Actions905

Overview

This node operation cancels a specific pipeline in a GitLab project by sending a POST request to the GitLab API endpoint `/api/v4/projects/{id}/pipelines/{pipeline_id}/cancel`. It is useful for automating the cancellation of running or queued pipelines in GitLab projects, for example, to stop unnecessary builds or deployments.

Use Case Examples

  1. Cancel a running pipeline in a project by specifying the project ID and pipeline ID to stop the pipeline execution.
  2. Automate pipeline management by integrating this node to cancel pipelines based on custom conditions in a CI/CD workflow.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using 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, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to POST.
Path Parameters The path parameters required for the API request, including the project ID (`id`) and the pipeline ID (`pipeline_id`) to identify which pipeline to cancel.

Output

JSON

  • id - The ID of the canceled pipeline.
  • status - The status of the pipeline after cancellation.
  • ref - The Git reference (branch or tag) associated with the pipeline.
  • sha - The commit SHA associated with the pipeline.
  • web_url - The URL to view the pipeline in GitLab.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and pipeline ID are correctly specified and exist in the GitLab instance.
  • Verify that the API key credential has sufficient permissions to cancel pipelines in the project.
  • If skipping authentication, ensure the GitLab instance allows unauthenticated requests for this operation, which is uncommon.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.

Links

Discussion