Pull request tilte
  • Updated on 22 Apr 2019
  • 1 minute to read
  • Contributors
  • Share
  • Dark
    Light

Pull request tilte

  • Share
  • Dark
    Light

Go to Datree's "custom rules" tab and click on "create new rule" button

3x-7d2fdb6-1.png

1. Choose custom rule type

Step 1 at the wizard - choose "custom pull request title"

aa311d7-Screen_Shot_2019-03-19_at_10.23.13

2. Edit custom rule details

The rule description will be shown on the custom rule dashboard, while the rule title will be used on GitHub "smart policy" check

6185c30-Screen_Shot_2019-03-19_at_10.33.14

3. Configure your custom rule

  • Regular Expression - which pattern should be validated for the pull request title

fcd8f7f-Screen_Shot_2019-03-19_at_10.40.58

ℹ️ The following regular expression will verify that every pull request title has at least 3 (not space/empty) characters:

^[^\s]{1,3}.*$
  • Test Text - an input box to test your regex 😎

0bb3473-Screen_Shot_2019-03-19_at_10.39.03

4. Wrap it up

Click on the "create" button to add your custom policy to the policies menu on the left

4598349-Screen_Shot_2019-03-19_at_10.40.58

By default, the rule will not be enabled until explicitly defining repositories

015adb8-Screen_Shot_2019-03-19_at_10.43.03

5. See your custom policy in action!

PR title will NOT pass the policy:

A. 323a3cc-Screen_Shot_2019-03-19_at_10.49.01

B. c3199c1-Screen_Shot_2019-03-19_at_10.52.30

C. fbd3086-Screen_Shot_2019-03-19_at_10.50.04

After fixing the PR title:

A. 8ebba8d-Screen_Shot_2019-03-19_at_10.55.47

B. c42e8e2-Screen_Shot_2019-03-19_at_10.56.10

Was this article helpful?