GitLab API

GitlabTool

Actions1000

Overview

This node operation is designed to unprotect a specific branch in a GitLab project repository. It is useful in scenarios where a protected branch needs to be made editable or modifiable again, such as when a development team wants to allow changes to a previously protected branch for further development or hotfixes. For example, a user can specify the project ID and branch name to remove branch protection via the GitLab API.

Use Case Examples

  1. Unprotecting a feature branch in a GitLab project to allow direct commits.
  2. Temporarily unprotecting a release branch to apply urgent fixes.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to GET but can be set to PUT for this operation.
Path Parameters Parameters required in the API path to identify the project and branch to unprotect.

Output

JSON

  • id - The ID or URL-encoded path of the project specified in the request.
  • branch - The name of the branch that was unprotected.
  • statusCode - The HTTP status code returned by the API indicating the result of the unprotect operation.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and branch name are correctly specified and URL-encoded if necessary.
  • Verify that the authentication credentials are valid and have sufficient permissions to unprotect branches in the project.
  • Check the base URL to ensure it points to the correct GitLab instance if using a self-hosted GitLab server.
  • Common error messages include 404 Not Found if the project or branch does not exist, and 403 Forbidden if the user lacks permission to unprotect the branch.

Links

Discussion