Skip to content

Commit 411a984

Browse files
lsfreitasyaronkaikov
authored andcommitted
Auto backport - promoted-to-master label not having effect
Currently adding a label backport-x.x is enough to open a backport PR. The issue is that the github action is only checking for backport labels while the script if we have args.pull_request will ignore completely this label again. With this fix I'm setting the check for labels including the promoted_label outside of the else statement. This way the script will always check it. Refs: scylladb/scylla-pkg#4979
1 parent d7eb8b5 commit 411a984

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: .github/scripts/auto-backport.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,17 @@ def main():
146146
closed_prs = [pr]
147147

148148
for pr in closed_prs:
149+
labels = [label.name for label in pr.labels]
149150
if args.pull_request:
150151
backport_labels = [args.label]
151152
else:
152-
labels = [label.name for label in pr.labels]
153153
backport_labels = [label for label in labels if backport_label_pattern.match(label)]
154-
if promoted_label not in labels:
155-
print(f'no {promoted_label} label: {pr.number}')
156-
continue
157-
if not backport_labels:
158-
print(f'no backport label: {pr.number}')
159-
continue
154+
if promoted_label not in labels:
155+
print(f'no {promoted_label} label: {pr.number}')
156+
continue
157+
if not backport_labels:
158+
print(f'no backport label: {pr.number}')
159+
continue
160160
commits = get_pr_commits(repo, pr, stable_branch, start_commit)
161161
logging.info(f"Found PR #{pr.number} with commit {commits} and the following labels: {backport_labels}")
162162
for backport_label in backport_labels:

0 commit comments

Comments
 (0)