Skip to content
Back to skills

Gitlab Protected Branches

ASecurity

Manages protected branches in GitLab. Use for protecting/unprotecting branches, code owner approvals. Triggers: branch protection.

  • 666 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added February 8, 2026
developmentgit

Works with

  • mcp

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill gitlab-protected-branches --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gitlab Protected Branches?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gitlab Protected Branches
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-gitlab-protected-branches/badge)](https://www.skillsdirectory.com/skills/majiayu000-gitlab-protected-branches)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gitlab-protected-branches
description: "Manages protected branches in GitLab. Use for protecting/unprotecting branches, code owner approvals. Triggers: branch protection."
---

### Overview
Secures branches.

### Available Tools
- `get_protected_branches`: Retrieve a list of protected branches in a specific GitLab project or Retrieve details of a specific protected branch in a GitLab project..
  - **Parameters**:
    - `project_id` (str): Optional. - Project ID or path
    - `branch` (Optional[str]): Optional. - Name of the branch to retrieve (e.g., 'main')
- `protect_branch`: Protect a specific branch in a GitLab project with specified access levels.
  - **Parameters**:
    - `project_id` (str): Optional. - Project ID or path
    - `branch` (str): Optional. - Name of the branch to protect (e.g., 'main')
    - `push_access_level` (Optional[str]): Optional. - Access level for pushing (e.g., 'maintainer')
    - `merge_access_level` (Optional[str]): Optional. - Access level for merging (e.g., 'developer')
    - `unprotect_access_level` (Optional[str]): Optional. - Access level for unprotecting (e.g., 'maintainer')
    - `allow_force_push` (Optional[bool]): Optional. - Whether force pushes are allowed
    - `allowed_to_push` (Optional[List[Dict]]): Optional. - List of users or groups allowed to push
    - `allowed_to_merge` (Optional[List[Dict]]): Optional. - List of users or groups allowed to merge
    - `allowed_to_unprotect` (Optional[List[Dict]]): Optional. - List of users or groups allowed to unprotect
    - `code_owner_approval_required` (Optional[bool]): Optional. - Whether code owner approval is required
    - `ctx` (Optional[Context]): Optional. - MCP context for progress
- `unprotect_branch`: Unprotect a specific branch in a GitLab project.
  - **Parameters**:
    - `project_id` (str): Optional. - Project ID or path
    - `branch` (str): Optional. - Name of the branch to unprotect (e.g., 'main')
    - `ctx` (Optional[Context]): Optional. - MCP context for progress
- `require_code_owner_approvals_single_branch`: Require or disable code owner approvals for a specific branch in a GitLab project.
  - **Parameters**:
    - `project_id` (str): Optional. - Project ID or path
    - `branch` (str): Optional. - Name of the branch to set approval requirements for (e.g., 'main')
    - `code_owner_approval_required` (bool): Optional. - Whether code owner approval is required
    - `ctx` (Optional[Context]): Optional. - MCP context for progress

### Usage Instructions
1. Access levels: push/merge.

### Examples
- Protect: `protect_branch` with project_id="123", branch="main", push_access_level="maintainer".
- Code owners: `require_code_owner_approvals_single_branch` with code_owner_approval_required=true.

### Error Handling
- Already protected: Update instead.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.