Go to Datree's "custom rules" tab and click on "create new rule" button
1. Choose custom rule type
Step 1 at the wizard - choose "custom Pull Request description"
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
3. Configure your custom rule
- Regular Expression - which pattern should be validated for the Docker image property
π 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.
By default, the rule will not be enabled until explicitly defining repositories