Skip to content

Commit cb13658

Browse files
committed
Skip label should not be used in combination with other backport labels
1 parent 1956876 commit cb13658

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
4949
echo "::endgroup::"
5050
51+
has_skip_backport_label=false
5152
has_exact_backport_label=false
5253
declare -A pr_exact_majors=()
5354
declare -A pr_floating_majors=()
@@ -56,7 +57,7 @@ jobs:
5657
5758
for pr_label in "${pr_labels[@]}"; do
5859
if [ "${pr_label}" = "skip-backport" ]; then
59-
has_exact_backport_label=true
60+
has_skip_backport_label=true
6061
echo "${pr_label}"
6162
continue
6263
fi
@@ -81,7 +82,13 @@ jobs:
8182
8283
echo "::endgroup::"
8384
84-
if [ "${has_exact_backport_label}" != true ]; then
85+
if [ "${has_skip_backport_label}" = true ] && [ "${has_exact_backport_label}" = true ]; then
86+
echo "::error::The 'skip-backport' not be used in combination with another backport"\
87+
"label."
88+
exit 1
89+
fi
90+
91+
if [ "${has_skip_backport_label}" != true ] && [ "${has_exact_backport_label}" != true ]; then
8592
echo "::error::No exact backport label found. Please add at least one of the"\
8693
"'backport {major}.{minor}' labels or use 'skip-backport',"\
8794
"if this PR should not be backported."

0 commit comments

Comments
 (0)