Skip to content

Enforce PR Semantic Title Names

Automatically enforce PR naming conventions; this example expects the format: <type>(<scope>): <short summary>

Enforce PR Semantic Title Names

Configuration Description

Conditions (all must be true):

  • The PR fails to follow a predefined semantic release format:

Automation Actions:

  • Request changes and post a comment explaining why.

Enforce PR Semantic Title Names

# -*- mode: yaml -*-
  version: 1.0
      - {{ pr.title | match(regex=titlePolicy.titleRegex) | nope }}
      - action: request-changes@v1
          comment: | 
            All PRs must be titled according to our semantic naming policy: `<type>(<scope>): <short summary>`

            Type must be one of the following:

             * build
             * ci 
             * docs
             * feature
             * fix

            Scope must be one of the following:

             * common
             * core
             * elements
             * forms
             * http 
    titleRegex: r/\b(build|ci|docs|feature|fix)\b\s*\((common|core|elements|forms|http)\):\s*\w+.*/

Additional Resources

gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.

Learn More about how gitStream Works.

Related Automations:

More Automations can be found on the Automation Library and Integrations pages.