-
-
Save jillr/3ea18312c5cef54ef07c47e8a180de6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# Simplified BSD License https://opensource.org/licenses/BSD-2-Clause) | |
# | |
from github import Github | |
g = Github("access_token") | |
repo = g.get_repo("ansible-collections/collection_name") | |
pulls = repo.get_pulls(state='open', base='master') | |
for pr in pulls: | |
pr.edit(base='main') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can verify that it works as expected!
(If you have a PR for merging
main
intomaster
, it will fail for that one. I had a WIP PR to see whether CI ran though. After skipping itif pr.number == XX: continue
) it worked fine.)You can add
print('#{0} "{1}": merge {2} into "{3}"'.format(pr.number, pr.title, '{0}@{1}'.format(pr.head.repo.full_name, pr.head.ref), pr.base.ref))
before thepr.edit()
call to see which PR is currently processed.