Homebrew / actions

🚀 Homebrew's GitHub Actions
BSD 2-Clause "Simplified" License
122 stars 39 forks source link

limit-pull-requests: new action #498

Closed ZhongRuoyu closed 8 months ago

ZhongRuoyu commented 8 months ago

Resolves #337.

Sample usage:

- uses: Homebrew/actions/limit-pull-requests@master
  with:
    except-users: |
      BrewTestBot
    # https://docs.github.com/en/graphql/reference/enums#commentauthorassociation
    except-author-associations: |
      MEMBER
    comment-limit: 10
    comment: >
      You already have 10 pull requests open. Please consider working on getting
      the existing ones merged before opening new ones. Thanks!
    close-limit: 50
    close: true

An except-author-associations list is also accepted (e.g. MEMBER). We can discuss the exact rules when applying the action to the repos.

ZhongRuoyu commented 8 months ago

I think we should be setting this at a limit (can always start higher) that we do start autoclosing).

I've split the limit input into comment-limit and close-limit so that we can post comment at a lower limit and autoclose at a higher one (say 10 and 50 respectively).

ZhongRuoyu commented 8 months ago

Presumably this does not use the search API (and the correspondingly low rate limit)?

No it doesn't. I tried invoking this a few times and querying the /rate_limit API. It's using GraphQL.

ZhongRuoyu commented 8 months ago

Let's try this.