Skip to content

Commit

Permalink
docs: Specific validation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
stevoland committed May 20, 2024
1 parent 78015a9 commit fc9bfee
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,23 @@ overridevalidators:
A sample of `deployment-settings` file is found [here](docs/sample-settings/sample-deployment-settings.yml).

#### Specific validation messages

Validators can also throw errors rather than returning `false` in order to provide specific messages:

```yaml
configvalidators:
- plugin: collaborators
error: |
`Invalid collaborators config`
script: |
if (baseconfig.permission == 'admin') {
throw new Error(`collaborator permission: admin not allowed`)
}
return true
```
### Performance
When there are 1000s of repos to be managed -- and there is a global settings change -- safe-settings will have to work efficiently and only make the necessary API calls.
Expand Down

0 comments on commit fc9bfee

Please sign in to comment.