- Notifications
You must be signed in to change notification settings - Fork673
-
I would like to automatically create a merge request approval rule.
Any idea how to fix this? |
BetaWas this translation helpful?Give feedback.
All reactions
I found a solution
project = gl.projects.get("my-project")main_branch = project.protectedbranches.get("main")project.approvalrules.create( { "name": rule_name, "approvals_required": 1, "rule_type": "regular", "protected_branch_ids": [main_branch_id.id], "group_ids": approver_group_ids, } )
Replies: 2 comments
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I'm not sure if this is even supported by the GitLab API:https://archives.docs.gitlab.com/17.11/api/merge_request_approvals/#create-project-approval-rule |
BetaWas this translation helpful?Give feedback.
All reactions
-
I found a solution
|
BetaWas this translation helpful?Give feedback.