GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation unprotects a specific branch in a GitLab project repository by making a PUT request to the GitLab API endpoint `/api/v4/projects/{id}/repository/branches/{branch}/unprotect`. It is useful for scenarios where a protected branch needs to be made editable again, such as allowing developers to push changes or merge requests to that branch. For example, a user might use this node to unprotect the 'main' branch of a project to allow hotfixes or urgent updates.

Use Case Examples

  1. Unprotect the 'develop' branch of a project with ID '12345' to allow team members to push changes.
  2. Unprotect a feature branch to enable merging after review.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the request (boolean). Defaults to false.
Authentication The authentication method used for the request, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the request, default is PUT.
Path Parameters Parameters used in the request path to specify the project and branch to unprotect.

Output

JSON

  • response - The JSON response from the GitLab API confirming the branch has been unprotected or providing details of the branch.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID and branch name are correct and URL-encoded if necessary.
  • Verify that the API authentication token has sufficient permissions to unprotect branches in the project.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error messages include 404 Not Found if the project or branch does not exist, and 403 Forbidden if the authentication token lacks permissions.

Links

Discussion