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

Inverse to `has_author_in`

Open ItsDrike opened this issue 3 years ago • 0 comments

I was looking through your readme and there doesn't seem to be a way to only run given check if it wasn't authored by someone. For example for my smaller project, I'd like to have a way of only running certain check if it wasn't authored by our core-dev team because I know I can trust them and they don't need approval, since we don't have enough people for all of these approvals.

Currently, I have to do something like:

policy:
  approval:
    - or:
      - core dev approved
      - core dev authored

which causes issues because I want to have automatic github review request for core dev approved check, but automatic approval if it was authored by core-dev, since there isn't a way to ignore PRs authored by core-devs, it requests review even if the approve rule passes, due to core dev authored passing.

There should be something like:

approval_rules:
  - name: core dev approved
    if:
      author_not_in:
        teams:
          - "myorg/core-developers"
    requires:
      count: 1
      teams:
        - "Codin-Nerds/core-developers"

Alternatively, add a full not predicate, which would be much more versatile and provide this "ignore if" feature for anything.

ItsDrike avatar Feb 07 '21 17:02 ItsDrike