GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation cancels a specific pipeline in a GitLab project by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/pipelines/{pipeline_id}/cancel`. It is useful for automating the management of CI/CD pipelines, such as stopping a running pipeline when certain conditions are met or when a manual intervention is required.

Use Case Examples

  1. Automatically cancel a pipeline if a new commit is pushed to the branch to save resources.
  2. Manually trigger pipeline cancellation from a workflow when a related task fails.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, typically an API key credential.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, which is POST for this operation.
Path Parameters The path parameters required for the API request, including the project ID or URL-encoded path and the pipeline ID to cancel.

Output

JSON

  • id - The ID of the canceled pipeline.
  • status - The status of the pipeline after cancellation.
  • ref - The branch or tag name 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 authentication token

Troubleshooting

  • Ensure the project ID and pipeline ID are correct and exist in the GitLab instance.
  • Verify that the API authentication token has sufficient permissions to cancel pipelines.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error: 404 Not Found - The project or pipeline ID does not exist or is inaccessible.
  • Common error: 401 Unauthorized - Authentication token is missing or invalid.

Links

Discussion