Skip to content

allow bots to automerge PR if all checks pass #7845

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tomasmatus
Copy link
Member

Comment on lines +67 to +70
# if not is_ci_bot(api, pr_num):
# logger.info("PR not made by CI bot, skipping automerge")
# return

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on purpose for testing

@tomasmatus
Copy link
Member Author

hmm right, I didn't realize that the runners won't run the code from here lol

@tomasmatus tomasmatus force-pushed the automerge-bots branch 2 times, most recently from caf32dc to 04f128a Compare June 5, 2025 11:03
@tomasmatus
Copy link
Member Author

tomasmatus commented Jun 5, 2025

The way I think this could work (just dropping my ideas here to not forget):

run-queue starts a job as usual. If this job runs against a Pull Request then check who is the author of this PR.
If the author is our cockpituous bot or the github-ci bot then this PR is a candidate for automerge if all checks are green.

Since this would run at the end of run-queue then the current running job should already be ACKed and marked as pass/fail on github so the following API request to check status of checks should be up to date.

To figure out which checks should pass maybe this could connect to the testmap and validate that all required checks actually ran and none are missing.

--
Now i need to see if I can run this locally to some extent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant