Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can I have approval rule with has_author_in but in not form #840

Open
MahmoudMabrok opened this issue Sep 16, 2024 · 1 comment
Open

can I have approval rule with has_author_in but in not form #840

MahmoudMabrok opened this issue Sep 16, 2024 · 1 comment

Comments

@MahmoudMabrok
Copy link

Can we have something like not_has_author_in so rule is not needed as long as author not in list I provide.

the case I have :

  • have a admin team
  • have dev team

if pr is by dev team, so need two approval one from dev team and one from admin team, but if author is admin , we need admin team approval only.

@bluekeyes
Copy link
Member

Could you share an example of the policy you'd write if this predicate existed? I think it should be possible to implement what you described with existing features:

policy:
  approval:
    - dev changes are approved by dev
    - dev changes are approved by admin
    - admin changes are approved by admin

approval_rules:
  - name: dev changes are approved by dev
    if:
      has_author_in:
        teams: ["org/dev-team"]
    requires:
      count: 1
      teams: ["org/dev-team"]

  - name: dev changes are approved by admin
    if:
      has_author_in:
        teams: ["org/dev-team"]
    requires:
      count: 1
      teams: ["org/admin-team"]

  - name: admin changes are approved by admin
    if:
      has_author_in:
        teams: ["org/admin-team"]
    requires:
      count: 1
      teams: ["org/admin-team"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants