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

Match if author has admin or write permission on the repository #451

Open
alecmocatta opened this issue Jul 16, 2019 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@alecmocatta
Copy link

alecmocatta commented Jul 16, 2019

An attribute like author_has_write, a Boolean representing whether the PR author has admin or write permission on the repository, would I think solve my use case.


Use case:

I would like PRs to be automatically merged after 1 approving review and a status check success. This works perfectly when there are other reviewers to review one's PR:

pull_request_rules:
  - name: automatic merge
    conditions:
      - base=master
      - status-success="travis"
      - label!=work-in-progress
      - "#approved-reviews-by>=1"
      - "#review-requested=0"
      - "#changes-requested-reviews-by=0"
      - "#commented-reviews-by=0"
    actions:
      merge:
        method: merge
        strict: smart
      delete_head_branch: {}

I'd also like to use this on projects where I'm the sole maintainer, but unfortunately GitHub doesn't let one review one's own PR. So I've added another rule that exempts PRs by me from requiring a review that GitHub won't allow me to give:

pull_request_rules:
  - name: automatic merge
    conditions:
      - base=master
      - status-success="travis"
      - label!=work-in-progress
      - author=alecmocatta
      - "#review-requested=0"
      - "#changes-requested-reviews-by=0"
      - "#commented-reviews-by=0"
    actions:
      merge:
        method: merge
        strict: smart
      delete_head_branch: {}

This works, but I think ideally I'd like to replace author=alecmocatta with a new author_has_write attribute. Let me know if there's another solution I'm missing!

@jd
Copy link
Member

jd commented Jul 16, 2019

That sounds like a nice idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants