GitlabApprovalRule

Schema

Only if the project’s spec.approvalRules entire array is left undefined will the configDefaults.approvalsConfig of the referenced GitlabDefaults be used.

For detailed info about the properties, please reference GitLab’s documentation.

PropertyTypeRequiredDescription
namestringYesName of the approval rule
approvalsRequirednumberYesNumber of approvals required from this rule
ruleTypeany_approver | regular | report_approverYesType of approval rule: any approver, specific approvers, or report-based approvers
appliesToAllProtectedBranchesbooleanYesWhether this rule applies to all protected branches or specific branches
usernamesstring arrayNoList of usernames who can approve (only for regular rule type)
groupIdsnumber arrayNoList of group IDs whose members can approve (only for regular rule type)
protectedBranchIdsnumber arrayNo*List of protected branch IDs this rule applies to (*required when appliesToAllProtectedBranches is false)
reportTypereport_approver | code_coverageNoType of report that requires approval (only for report_approver rule type)

Note: The groupIds field is currently accepted by the schema but is not sent to the GitLab API. Setting it will have no effect.

The ruleType and reportType fields can only be set during approval rule creation. Changing these fields on an existing rule will not update them on GitLab.