start writing up structs for rules API payloads
This commit is contained in:
parent
bcb4194692
commit
79113bd304
1 changed files with 39 additions and 0 deletions
39
pkg/cmd/ruleset/rules.go
Normal file
39
pkg/cmd/ruleset/rules.go
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
package ruleset
|
||||
|
||||
type RuleType string
|
||||
type Enforcement string
|
||||
type MatchingOperator string
|
||||
|
||||
const (
|
||||
RuleTypeCommitAuthorEmailPattern RuleType = "commit_author_email_pattern"
|
||||
RuleTypePullRequest RuleType = "pull_request"
|
||||
// TODO others
|
||||
|
||||
EnforcementEnabled Enforcement = "enabled"
|
||||
EnforcementDisabled Enforcement = "disabled"
|
||||
|
||||
MatchingOperatorStartsWith MatchingOperator = "starts_with"
|
||||
MatchingOperatorEndsWith MatchingOperator = "ends_with"
|
||||
MatchingOperatorContains MatchingOperator = "contains"
|
||||
MatchingOperatorRegex MatchingOperator = "regex"
|
||||
)
|
||||
|
||||
type ConfigurationPullRequest struct {
|
||||
DissmissStaleReviewsOnPush bool
|
||||
RequireCodeOwnerReview bool
|
||||
RequestLastPushApproval bool
|
||||
RequiredApprovingReviewCount int
|
||||
}
|
||||
|
||||
type BranchNamePattern struct {
|
||||
Name string
|
||||
Negate bool
|
||||
Operator MatchingOperator
|
||||
}
|
||||
|
||||
type Rule struct {
|
||||
ID string
|
||||
Type RuleType
|
||||
Enforcement Enforcement
|
||||
Configuration interface{}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue