Pull Request description
  • Updated on 30 May 2019
  • 1 minute to read
  • Contributors
  • Share
  • Dark
    Light

Pull Request description

  • 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 description"

step1

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

step2

3. Configure your custom rule

  • Regular Expression - which pattern should be validated for the Docker image property

step3

πŸ™Š Mandatory Pull Request description:

For example, setting the regular expression .{10,} will make sure the Pull Request description won't be empty (must includ at least 10 characters).

πŸ™ˆ Pull Request template followed:

For example, setting the regular expression -\s\[x\] will make sure at lease one item is checked in the Pull Request template list.

πŸ™‰ Completion of task lists:

RegEx: (-\s\[x\].+\r?\n?){<NUMBER_OF_ITEMS>}

For example, if I have 5 items on my task list (A.K.A checklist) the regular expression (-\s\[x\].+\r?\n?){5} will verify the rule is passing only when all items are checked as "done".

4. Wrap it up

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

step4

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

5. See your custom policy in action!

Pull Request description which will NOT pass the policy:

fail1

fail2

After updating the Pull Request description:

pass1

pass2

Was this article helpful?