mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-27 20:05:10 +00:00
.github/scripts/auto-backport.py: update method to get closed prs
`commit.get_pulls()` in PyGithub returns pull requests that are directly associated with the given commit
Since in closed PR. the relevant commit is an event type, the backport
automation didn't get the PR info for backporting
Ref: https://github.com/scylladb/scylladb/issues/18973
Closes scylladb/scylladb#21468
(cherry picked from commit ef104b7b96)
Closes scylladb/scylladb#21483
This commit is contained in:
committed by
Botond Dénes
parent
d33538bdd4
commit
9eed1d1cbd
5
.github/scripts/auto-backport.py
vendored
5
.github/scripts/auto-backport.py
vendored
@@ -150,7 +150,10 @@ def main():
|
||||
start_commit, end_commit = args.commits.split('..')
|
||||
commits = repo.compare(start_commit, end_commit).commits
|
||||
for commit in commits:
|
||||
for pr in commit.get_pulls():
|
||||
match = re.search(rf"Closes .*#([0-9]+)", commit.commit.message, re.IGNORECASE)
|
||||
if match:
|
||||
pr_number = int(match.group(1))
|
||||
pr = repo.get_pull(pr_number)
|
||||
closed_prs.append(pr)
|
||||
if args.pull_request:
|
||||
start_commit = args.head_commit
|
||||
|
||||
Reference in New Issue
Block a user