Skip to content

Commit 2675895

Browse files
committed
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#4979
1 parent d7eb8b5 commit 2675895

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/scripts/auto-backport.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ def main():
151151
else:
152152
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)