Skip to content

Commit b50df7a

Browse files
committed
Fix logic 2
1 parent 7305a1d commit b50df7a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ jobs:
9090
exit 1
9191
fi
9292
93+
// Validate that a floating backport label exists for each exact backport label major
94+
// version.
95+
9396
has_floating_backport_labels=true
9497
9598
for pr_major in "${pr_majors[@]}"; do
@@ -121,3 +124,27 @@ jobs:
121124
if [ "${has_floating_backport_labels}" != true ]; then
122125
exit 1
123126
fi
127+
128+
// Validate that an exact backport label exists for each floating backport label major
129+
// version.
130+
131+
has_exact_backports_labels=true
132+
133+
for pr_floating_major in "${pr_floating_majors[@]}"; do
134+
exists_exact_major=false
135+
for pr_major in "${pr_majors[@]}"; do
136+
if [ "${pr_floating_major}" -eq "${pr_major}" ]; then
137+
has_exact_major=true
138+
fi
139+
done
140+
141+
if [ "${has_exact_major}" != true ]; then
142+
has_exact_backport_labels=false
143+
echo "::error::Missing exact backport label for '${pr_floating_major}.x'"
144+
fi
145+
done
146+
147+
if [ "${has_exact_backport_labels}" != true ]; then
148+
exit 1
149+
fi
150+

0 commit comments

Comments
 (0)