Skip to content

Commit 852635d

Browse files
committed
Do not allow standalone floating backport labels
1 parent 29a1f24 commit 852635d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/check-backport-labels.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
5454
echo "::endgroup::"
5555
56-
has_backport_label=false
56+
has_exact_backport_label=false
5757
pr_majors=()
5858
pr_floating_majors=()
5959
@@ -62,13 +62,14 @@ jobs:
6262
for pr_label in "${pr_labels[@]}"; do
6363
for backport_label in "${all_backport_labels[@]}"; do
6464
if [ "${pr_label}" = "${backport_label}" ]; then
65-
has_backport_label=true
65+
has_exact_backport_label=true
6666
6767
if [[ "${pr_label}" =~ ${backport_regex} ]]; then
6868
major="${BASH_REMATCH[1]}"
6969
minor="${BASH_REMATCH[2]}"
7070
pr_majors+=("${major}")
7171
if [ "${minor}" = "x" ]; then
72+
has_exact_backport_label=false
7273
pr_floating_majors+=("${major}")
7374
fi
7475
fi
@@ -80,8 +81,10 @@ jobs:
8081
8182
echo "::endgroup::"
8283
83-
if [ "${has_backport_label}" != true ]; then
84-
echo "::error::No backport label found. Please add at least one of the 'backport {x}.{x}' labels or 'skip-backport', if this PR should not be backported."
84+
if [ "${has_exact_backport_label}" != true ]; then
85+
echo "::error::No exact backport label found. Please add at least one of the "\
86+
"'backport {major}.{minor}' labels or use 'skip-backport', "\
87+
"if this PR should not be backported."
8588
exit 1
8689
fi
8790

0 commit comments

Comments
 (0)