GitLab API

GitlabTool

Actions1000

Overview

This node operation deletes a specific branch from a GitLab project repository using the GitLab API. It is useful for managing branches programmatically, such as cleaning up old or unused branches in a project. For example, a user can automate branch deletion after a feature is merged or a release is completed.

Use Case Examples

  1. Automate deletion of feature branches after merge.
  2. Remove stale branches from a project repository.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used for the request, default is GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but DELETE is used for this operation.
Path Parameters Parameters for the API path, including project ID and branch name to delete.

Output

JSON

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

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and branch name are correctly specified and URL-encoded if necessary.
  • Verify that the API key has sufficient permissions to delete branches in the project.
  • Check the base URL if using a self-hosted GitLab instance instead of gitlab.com.
  • Common error: 404 Not Found - The project or branch does not exist or the user lacks access.
  • Common error: 403 Forbidden - The API key does not have permission to delete branches.

Links

Discussion