Rulesets is a GitHub App built with Probot that automates pull request workflows, enforces code quality standards, and streamlines the review process. By defining rules in a YAML configuration file, you can automatically validate pull requests against your team’s conventions and trigger appropriate actions based on validation results.

Key Features

Flexible Configuration

Define your rules in a simple YAML format that’s easy to understand and maintain

Event-Driven

Trigger rules based on various GitHub webhook events like opening or updating PRs

Conditional Logic

Apply rules only when specific conditions are met

Powerful Validations

Validate PRs against a wide range of criteria including titles, descriptions, and more

Automated Actions

Take automated actions based on validation results

Template Support

Use variables in your messages and comments for dynamic content

How It Works

  1. Install the Rulesets GitHub App on your repository
  2. Create a .github/Ruleset.yml configuration file
  3. Define your ruleset with events, conditions, validations, and actions
  4. When a pull request is created or updated, Rulesets automatically applies your rules

Example Configuration

ruleset:
  - name: "Conventional Commit Format"
    when:
      - "pull_request.opened"
      - "pull_request.edited"
    validate:
      - type: "title"
        match: "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\\(\\w+\\))?: .+"
        message: "PR title must follow conventional commit format"
    on_success:
      - label:
          add: ["conventional-format"]
    on_failure:
      - comment:
          body: "Please follow the conventional commit format for your PR title"

This example rule validates that PR titles follow the conventional commit format, adds a label when they do, and comments when they don’t.

Benefits

  • Consistent PR Quality: Enforce standards automatically
  • Reduced Manual Work: Automate repetitive review tasks
  • Faster Reviews: Focus on code, not checklists
  • Better Onboarding: Help new contributors understand your workflow
  • Customizable Workflow: Adapt to your team’s specific needs