mirror of
https://github.com/github/codeql-action.git
synced 2026-10-21 02:01:27 +00:00
Fix unused sorted value in update-release-branch
Fix a minor issue in the update-release-branch.py script that performs a call to `sorted` but doesn't use the output. Since `sorted` does not operate in place, the call is currently useless. As a result, the function `get_pr_for_commit` does not currently work as exected. I.e. it is expected to return the "first" (i.e. lowest PR number), but actually it returns the first in the list provided by GitHub.
This commit is contained in:
4
.github/update-release-branch.py
vendored
4
.github/update-release-branch.py
vendored
@@ -123,8 +123,8 @@ def get_pr_for_commit(repo, commit):
|
||||
if prs.totalCount > 0:
|
||||
# In the case that there are multiple PRs, return the earliest one
|
||||
prs = list(prs)
|
||||
sorted(prs, key=lambda pr: int(pr.number))
|
||||
return prs[0]
|
||||
sorted_prs = sorted(prs, key=lambda pr: int(pr.number))
|
||||
return sorted_prs[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user