Automatic merge Pull Request in Github [suggestion]

Viewed 327

Not a real question, rather a suggestion if anyone has faced the same needs.

Suppose to have a github repository with many contributors making PR. What are the best tools to automatic merge PR with the following condition:

  • in there is no activity for a while (e.g. 10 days) close the PR without merging it IF the author has NOT commit rights on the repo and merge it IF the author has commit rights

I found several useful tool, like github APP:

  • bulldozer that merges PR based on conditions (but not time intervals)
  • policy-bot that tags the PR as approved/not approved depending on some conditions
  • mergify that auto merges PR depending on different conditions (again, no time intervals)
  • writing a webhook?

In some ways I think that a synergy between APPs and other tools can solve the problem, but maybe there is a smoother way to do this.

Someone has some suggestions?

2 Answers

In some ways I think that a synergy between APPs and other tools can solve the problem

As other tools, don't forget GitHub Actions, like (for those regarding PR):

By looking at their implementation, you can make your own which will close a PR matching your criteria.

Jenkins can be used for this exact thing and more, and it doesn't necessarily need to be a GitHub repository, any git repo works the same.

For example, in my company we use it to scan BitBucket PR comments and perform complex commands according to the comments, allowing for validations, automation testing and more before performing potentially dangerous actions.

Jenkins can be easily integrated with your git repo, or also with GitHub.

https://plugins.jenkins.io/github/

https://plugins.jenkins.io/git/

Related