Merge pull request #24501 from abyss7/fix-backport

[backport] Find only opened PRs by label
This commit is contained in:
Nikita Mikhaylov 2021-05-27 02:49:57 +03:00 committed by GitHub
commit be67481946
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -28,7 +28,6 @@ class Backport:
def getBranchesWithRelease(self):
branches = set()
for pull_request in self._gh.find_pull_requests("release"):
if not pull_request['merged'] and not pull_request['closed']:
branches.add(pull_request['headRefName'])
return branches

View File

@ -48,7 +48,7 @@ class Query:
url
'''
def __init__(self, token, owner, name, team, max_page_size=100, min_page_size=5):
def __init__(self, token, owner, name, team, max_page_size=100, min_page_size=10):
self._PULL_REQUEST = Query._PULL_REQUEST.format(min_page_size=min_page_size)
self._token = token
@ -165,7 +165,7 @@ class Query:
'''
_QUERY = '''
repository(owner: "{owner}" name: "{name}") {{
pullRequests(first: {min_page_size} labels: "{label_name}") {{
pullRequests(first: {min_page_size} labels: "{label_name}" states: OPEN) {{
nodes {{
{pull_request_data}
}}