Skip to content
Back to skills

2640 Branch Ruleset Config 1e611247

ASecurity

> [Current Version](../VERSION.md) | Configuration guide for GitHub branch protection on `main`

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
testinggoshellbashazureterraformgitapi

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2640-branch-ruleset-config_1e611247 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2640 Branch Ruleset Config 1e611247?

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

Security grade badge for 2640 Branch Ruleset Config 1e611247
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2640-branch-ruleset-config-1e611247/badge)](https://www.skillsdirectory.com/skills/tools-only-2640-branch-ruleset-config-1e611247)

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

SKILL.md
# Branch Ruleset Configuration

> [Current Version](../VERSION.md) | Configuration guide for GitHub branch protection on `main`

## Overview

This document provides the exact `gh api` commands to configure branch
rulesets for the `azure-agentic-infraops` repository. These rules
enforce quality gates before merging to `main`.

## Required Status Checks

The following CI jobs must pass before a PR can merge:

| Job Name                     | Workflow File                 | Purpose                                         |
| ---------------------------- | ----------------------------- | ----------------------------------------------- |
| `lint`                       | `lint.yml`                    | Markdown, JSON, template lint                   |
| `Validate Agents & Skills`   | `agent-validation.yml`        | Agent frontmatter, skills, MCP                  |
| `policy-compliance-check`    | `policy-compliance-check.yml` | Governance guardrail integrity                  |
| `Terraform Support Complete` | `tf-dev-merge-gate.yml`       | Blocks `tf-dev` until all 8 phases are complete |

## Configuration via `gh api`

> The live ruleset is **`Main Branch Protection`** (ID `12080985`).
> Use `PUT` to update it in place — this preserves all existing rules.

### Update Existing Ruleset (PowerShell)

```powershell
@'
{
  "name": "Main Branch Protection",
  "target": "branch",
  "enforcement": "active",
  "conditions": {
    "ref_name": { "exclude": [], "include": ["refs/heads/main"] }
  },
  "rules": [
    { "type": "deletion" },
    { "type": "non_fast_forward" },
    {
      "type": "pull_request",
      "parameters": {
        "required_approving_review_count": 1,
        "dismiss_stale_reviews_on_push": true,
        "required_reviewers": [],
        "require_code_owner_review": true,
        "require_last_push_approval": false,
        "required_review_thread_resolution": true,
        "allowed_merge_methods": ["merge", "squash", "rebase"]
      }
    },
    { "type": "required_linear_history" },
    {
      "type": "required_status_checks",
      "parameters": {
        "strict_required_status_checks_policy": true,
        "do_not_enforce_on_create": false,
        "required_status_checks": [
          { "context": "lint" },
          { "context": "Validate Agents & Skills" },
          { "context": "policy-compliance-check" },
          { "context": "Terraform Support Complete" }
        ]
      }
    }
  ],
  "bypass_actors": [
    { "actor_id": 5, "actor_type": "RepositoryRole", "bypass_mode": "pull_request" }
  ]
}
'@ | gh api `
  --method PUT `
  -H "Accept: application/vnd.github+json" `
  /repos/jonathan-vella/azure-agentic-infraops/rulesets/12080985 `
  --input -
```

### Update Existing Ruleset (bash/Linux)

```bash
gh api \
  --method PUT \
  -H "Accept: application/vnd.github+json" \
  /repos/jonathan-vella/azure-agentic-infraops/rulesets/12080985 \
  --input - <<'EOF'
{
  "name": "Main Branch Protection",
  "target": "branch",
  "enforcement": "active",
  "conditions": {
    "ref_name": { "exclude": [], "include": ["refs/heads/main"] }
  },
  "rules": [
    { "type": "deletion" },
    { "type": "non_fast_forward" },
    {
      "type": "pull_request",
      "parameters": {
        "required_approving_review_count": 1,
        "dismiss_stale_reviews_on_push": true,
        "required_reviewers": [],
        "require_code_owner_review": true,
        "require_last_push_approval": false,
        "required_review_thread_resolution": true,
        "allowed_merge_methods": ["merge", "squash", "rebase"]
      }
    },
    { "type": "required_linear_history" },
    {
      "type": "required_status_checks",
      "parameters": {
        "strict_required_status_checks_policy": true,
        "do_not_enforce_on_create": false,
        "required_status_checks": [
          { "context": "lint" },
          { "context": "Validate Agents & Skills" },
          { "context": "policy-compliance-check" },
          { "context": "Terraform Support Complete" }
        ]
      }
    }
  ],
  "bypass_actors": [
    { "actor_id": 5, "actor_type": "RepositoryRole", "bypass_mode": "pull_request" }
  ]
}
EOF
```

## Configuration via GitHub UI

1. Go to **Settings > Rules > Rulesets** → open **Main Branch Protection**
2. Under **Require status checks to pass** → add the missing checks:
   - `Validate Agents & Skills`
   - `policy-compliance-check`
   - `Terraform Support Complete`
3. Click **Save changes**

## Verification

After configuring, verify with:

```powershell
gh api /repos/jonathan-vella/azure-agentic-infraops/rulesets/12080985 `
  -q '.rules[] | select(.type == "required_status_checks") | .parameters.required_status_checks[].context'
```

Expected output:

```text
lint
Validate Agents & Skills
policy-compliance-check
Terraform Support Complete
```

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.