GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation deletes merged branches from a GitLab project repository. It is useful for cleaning up branches that have already been merged, helping to maintain a tidy repository. For example, after completing a feature branch and merging it into the main branch, this operation can be used to remove the merged branch from the repository.

Use Case Examples

  1. Deleting merged branches from a specific GitLab project to keep the repository clean.
  2. Automating branch cleanup in a CI/CD pipeline after merge requests are completed.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the request.
Authentication The authentication method used for the request, defaulting to GitLab API key.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, defaulting to GET but DELETE is used for this operation.
Path Parameters The path parameters for the request, specifically the project ID or URL-encoded path to identify the project from which merged branches will be deleted.

Output

JSON

  • statusCode - HTTP status code of the delete operation response.
  • body - Response body from the GitLab API after attempting to delete merged branches.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and URL-encoded if necessary.
  • Verify that the API key used for authentication has sufficient permissions to delete branches in the specified project.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 401 Unauthorized (authentication failure), 404 Not Found (invalid project ID), and 403 Forbidden (insufficient permissions).

Links

Discussion