Setup Branch Protection

Configure GitHub branch protection with required status checks for DataSurface PR Validator.

2|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/datasurface/demo1 --skill setup-branch-protection-datasurface
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Setup Branch Protection
Source: https://github.com/datasurface/demo1/tree/main/.claude/skills/setup-branch-protection
Command: npx skills add https://github.com/datasurface/demo1 --skill setup-branch-protection-datasurface

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

DataSurface model repositories require robust branch protection to ensure changes go through PR reviews and pass automated validation. This skill guides admins through a two-step process to enable a status-check-driven protection after the initial PR validator run.

Core Features & Use Cases

  • Two-step protection setup: registers the status check by creating an initial PR, then enables the required status check on the main branch.
  • Works with GitHub Actions and GH CLI: uses gh secret checks and gh api to configure rulesets.
  • Use Case: A maintainer wants to enforce that all changes to their model repository go through PRs and pass the DataSurface PR Validator before merging.

Quick Start

Provide repository owner and name, then run the following steps:

  1. Ensure .github/workflows/pull-request.yml exists in the target repo.
  2. Create a branch and push a trivial file to trigger the DataSurface PR Validator.
  3. Use gh api to create a ruleset named Datasurface and enable the DataSurface PR Validator status.

Frequently Asked Questions about Setup Branch Protection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce a required status check for branch protection on GitHub?

To enforce a required status check for branch protection on GitHub, you must register the check by triggering it via an initial pull request, then apply a ruleset using the gh api to require that specific check on your main branch.

What is the process to set up DataSurface PR Validator branch protection?

Setting up DataSurface PR Validator branch protection involves a two-step process: first, push a trivial file to a new branch to create a PR and register the status check, then use gh api to create a ruleset requiring the DataSurface PR Validator before merging.

Do I need admin access to configure GitHub branch protection rulesets?

Yes, you need admin access to configure GitHub branch protection rulesets. Admin privileges are required to use the gh api to create rulesets, manage GitHub Actions secrets, and enforce required status checks on the repository.

Why does my required status check not appear when configuring GitHub branch protection?

Your required status check does not appear because it must be registered first. You need to create an initial pull request that triggers the DataSurface PR Validator workflow in GitHub Actions before the check becomes available to select in branch protection rules.

Can I use GitHub branch protection rulesets with the gh cli to require PR validation?

Yes, you can use GitHub branch protection rulesets with the gh cli to require PR validation. The setup uses gh api to create a ruleset named Datasurface and enables the DataSurface PR Validator status check for the main branch.

What prerequisites are needed to configure DataSurface model repository branch protection?

Prerequisites for DataSurface model repository branch protection include having the .github/workflows/pull-request.yml file in the target repo, admin access to the repository, and configured GitHub Actions secrets for the PR validator.