diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 12:38:06 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 12:38:06 +0000 |
commit | 695ad2c6d0b157d2969c9b946d9e3765113a61e7 (patch) | |
tree | eaab7e7e2523ad710afe779d532156258e40d5cc /tools/purge-PRs.py | |
parent | Initial commit. (diff) | |
download | powerline-695ad2c6d0b157d2969c9b946d9e3765113a61e7.tar.xz powerline-695ad2c6d0b157d2969c9b946d9e3765113a61e7.zip |
Adding upstream version 2.8.1.upstream/2.8.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/purge-PRs.py')
-rwxr-xr-x | tools/purge-PRs.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/purge-PRs.py b/tools/purge-PRs.py new file mode 100755 index 0000000..38f44d9 --- /dev/null +++ b/tools/purge-PRs.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8:noet +from __future__ import (unicode_literals, division, absolute_import, print_function) + +import argparse + +from getpass import getpass + +from github import Github + + +p = argparse.ArgumentParser(description='Powerline release script') +p.add_argument('-u', '--user', type=str, metavar='USER', help='Github username.', required=True) +p.add_argument('-p', '--password', type=str, metavar='PASS', help='Github password. You will be prompted if it is not supplied.') + +if __name__ == '__main__': + args = p.parse_args() + user = args.user + password = args.password or getpass('Password for {0}: '.format(user)) + gh = Github(user, password) + grepo = gh.get_repo('powerline/powerline') + for pr in grepo.get_pulls(): + if pr.base.ref != 'develop': + issue = grepo.get_issue(pr.number) + issue.create_comment('PRs to any branch, but develop, are not accepted.', ) + issue.add_to_labels('s:invalid') + issue.edit(state='closed') |