GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation deletes a protected branch from a specified project in GitLab. It is useful for managing project branches by removing branch protection when it is no longer needed or to allow changes to the branch that were previously restricted. For example, a user can delete the protection on the 'main' branch of a project to allow direct commits or merges.

Use Case Examples

  1. Deleting the 'main' protected branch from a project identified by its ID or URL-encoded path.
  2. Removing branch protection to enable new workflows or branch management policies.

Properties

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

Output

JSON

  • statusCode - HTTP status code of the delete operation response.
  • responseBody - Response body returned from the GitLab API after deleting the protected branch.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID or URL-encoded path and branch name are correctly specified; otherwise, the API call will fail.
  • Authentication errors may occur if the API key is missing or invalid; verify credentials.
  • HTTP method must be DELETE for this operation; using other methods will not perform the delete action.
  • Check network connectivity and GitLab instance availability if requests time out or fail.

Links

Discussion