Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed Aug 29, 2023
1 parent ae88106 commit 16e044d
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,30 @@ interface Report {
## Rule configuration file
This is the file where all the available rules are written.

**This file is only read from the main branch.** So if you modify the file the changes won’t happen until it is merged into the main branch.
This is done to stop users from modifying the rules in their own PRs.
**This file is only read from the main branch.** So if you modify the file, the changes won’t happen until it is merged into the main branch.
This is done to stop users from modifying the rules in their PRs.

It contains an object called `rules` which has an array of rules. Every rule has a same base structure:
It contains an object called `rules` which has an array of rules. Every rule has a same base structure. There is also a second optional field called `preventReviewRequests`.
```yaml
rules:
- name: Rule name
condition:
include:
- '.*'
exclude:
- 'README.md'
type: the type of the rule
preventReviewRequests:
users:
- user-a
- user-b
teams:
- team-a
- team-b
```

#### Rules fields
- **name**: Name of the rule. This value must be unique per rule.
- **condition**: This is an object that contains two values:
- **include**: An array of regex expressions of the files that match this rule.
Expand All @@ -185,8 +195,19 @@ It contains an object called `rules` which has an array of rules. Every rule has
- **or**: Has many review options, requires at least *one option* to be fulfilled.
- **and**: Has many review options, requires *all the options* to be fulfilled.
- **and-distinct**: Has many review options, requires *all the options* to be fulfilled *by different people*.

#### preventReviewRequests
This is a special field that applies to all the rules.

This field is **optional**.

It supports two fields: `users` and `teams`. If *the user is inside the users array, or they belong to one of the teams listed there, the validation will automatically be skipped, and a success status check will be reported*.

It is intended to stop the custom rules being required when a user is already trusted and doesn’t need such a thorough review process.

### Types
Every type has a *slightly* different configuration and works for different scenarios, so let’s analyze all of them.

#### Basic rule
As the name implies, this type is elementary. All the files that fall under the rule evaluation must receive a given number of approvals by the listed users and/or team members.

Expand Down

0 comments on commit 16e044d

Please sign in to comment.