GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation retrieves information about a specific protected branch in a GitLab project using the GitLab API. It is useful for scenarios where you need to get details about branch protection settings, such as permissions and restrictions, for a particular branch within a project. For example, it can be used to verify branch protection status before performing automated deployments or merges.

Use Case Examples

  1. Get details of the 'main' protected branch in the 'gitlab-org/gitlab' project to check its protection rules.
  2. Retrieve branch protection information to audit project branch security settings.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated API access.
Authentication Type of authentication to use for the API request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the API request, defaulting to GET.
Path Parameters Parameters to specify the project ID or URL-encoded path and the branch name to identify the protected branch.

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • name - The name of the protected branch.
  • protectionDetails - Details about the branch protection settings returned by the API, including permissions and restrictions.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and branch name are correctly URL-encoded and valid to avoid 404 Not Found errors.
  • If authentication is required, verify that the GitLab API key credential is correctly configured and has sufficient permissions.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure the API endpoint is reachable.

Links

Discussion