-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Setup a PR review bot #30816
Setup a PR review bot #30816
Conversation
do you have some examples of it working on your fork? |
Here are some examples. No template found, PR failed openpilot-.2.mp4Template found, PR passed openpilot-.4.mp4PR is edited, status is updated openpilot.mp4 |
does pygithub have an api for doing stuff like converting to draft, getting pull request id, etc? |
As far as I could discover, draft status cannot be be modified by the REST endpoint that PyGithub uses internally. Only the GraphQL endpoint can convert a PR to and from a draft. The required pull request id can only be obtained through the GraphQL endpoint. PyGithub only handles labels, I could remove it as a dependency and do everything through the GraphQL endpoint. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
This is bigger and more custom than I was expecting. This is pretty generic stuff, and it's important that it has basically no maintenance cost (i.e. in the next year, we don't have to touch it to get it working again because some endpoint changed or something). Are there existing Actions we can use instead? The ideal thing is a single action, but perhaps there's a few different ones we can chain together. There's also github-script which I imagine would simplify this a bit.
Created a PR review bot. It does the following:
bot-review
label and sets it to draft status..github/pull_request_template.md
).bot-review
label and removes the PR from draft status.The bot determines if a template has been used by looking at the
**bolded headings**
. It checks each known template against the body of the pull request.Editing the pull request body causes the PR review bot to run again.
Issue: #30715