policy-bot icon indicating copy to clipboard operation
policy-bot copied to clipboard

How we can exclude bot from approval

Open rajesh-dhakad opened this issue 1 year ago • 1 comments

We have a usecase where the gh-auto-approve bot approves the PR - how can I exclude gh-auto-approve from approval_rules?

Note: gh-auto-approve is part of our org/eng team which we want to keep as it is.

policy:
  approval:
        - the eng team approval

approval_rules:
  - name: the eng team approval
    requires:
      count: 1
      teams:
        - "org/eng"

rajesh-dhakad avatar Sep 20 '24 10:09 rajesh-dhakad

There's currently no support for ignoring approvals from specific users who otherwise meet the conditions specified in the rule. I think your best option will be to create a new team, maybe org/eng-approvers, as a nested team of the org/eng team and then move all of the users except for gh-auto-approve to the child team. Finally, update your policy to use the org/eng-approvers in the approval rule. Using a nested team should mean that you don't have to change anything else that uses the org/eng team.

bluekeyes avatar Sep 20 '24 16:09 bluekeyes