-
Notifications
You must be signed in to change notification settings - Fork 5
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
Added core functionality to auto-merge PRs #5
Conversation
It seems that 'method' can not be used
return; | ||
} | ||
|
||
if (this.pr.state === "closed") { |
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.
should we check against draft too?
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.
The state object only has closed
or open
.
I would say no anyways because it still needs to have the reviews. You can always set a project to auto-merge even if it is in draft state.
What do you think?
break; | ||
case "cancel": | ||
await this.commentsApi.reactToComment(this.comment.id, "+1"); | ||
await merger.disableAutoMerge(); |
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.
will it be okay if it's not enabled?
or if you enable - that it's already enabled?
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.
Yeah, I tested that out and it doesn't change the state if it is already set. Here you have an example where I called cancel even tho it isn't enabled.
Co-authored-by: Przemek Rzad <[email protected]>
also updated worflow to have the same effect
set-auto-merge: | ||
runs-on: ubuntu-latest | ||
# Important! This forces the job to run only on Pull Requests | ||
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/bot') }} |
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.
I guess, it's the right time to question /bot
part, and consider /merge
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.
I left this for a future task: #8
As I need to change a couple of things and thought it would be better there
Created base of the bot, with the ability to comment on a PR and to enable/disable auto-merge.
You can find a working example in paritytech-stg#1
This resolves #1
The bot can enable auto-merge, disable it and show the available commands.
If the user is not a member of the org or the author of the PR, the bot will not work. This is to stop external parties of enabling/disabling the bot.
This is a required step to solve polkadot-fellows/runtimes#41