Skip to content

Commit 6f13ae3

Browse files
committed
ci(check-pr): use literal comparison
1 parent 20ea6ac commit 6f13ae3

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

.github/workflows/check-pr.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: "Check PR"
33
on: pull_request
44

55
permissions:
6-
actions: write
7-
contents: write
86
pull-requests: write
97

108
jobs:
@@ -60,16 +58,14 @@ jobs:
6058
for label in build chore ci docs feat fix perf refactor test style ; do
6159
if [[ "${label}" == "${type}" ]]; then
6260
echo "Label to add: ${label}"
63-
# shellcheck disable=SC2076
64-
if [[ "${PR_LABELS}" =~ "\"${label}\"" ]] ; then
61+
if [[ "${PR_LABELS}" == *"${label}"* ]] ; then
6562
echo "Label ${label} already present"
6663
else
6764
add_labels+=("${label}")
6865
fi
6966
else
7067
echo "Label to remove: ${label}"
71-
# shellcheck disable=SC2076
72-
if [[ "${PR_LABELS}" =~ "\"${label}\"" ]] ; then
68+
if [[ "${PR_LABELS}" == *"${label}"* ]] ; then
7369
remove_labels+=("${label}")
7470
else
7571
echo "Label ${label} not present"
@@ -80,8 +76,7 @@ jobs:
8076
regexp2='^[a-zA-Z0-9]+\([a-zA-Z0-9\-]*deps\)$'
8177
if [[ "${scoped_type}" =~ ${regexp2} ]] ; then
8278
echo "Label to add: dependencies"
83-
# shellcheck disable=SC2076
84-
if [[ "${PR_LABELS}" =~ "\"dependencies\"" ]] ; then
79+
if [[ "${PR_LABELS}" == *"dependencies"* ]] ; then
8580
echo "Label dependencies already present"
8681
else
8782
add_labels+=('dependencies')
@@ -95,16 +90,14 @@ jobs:
9590
|| "${type}" == 'style' \
9691
|| "${type}" == 'test' ]] ; then
9792
echo "Label to add: no-release-notes"
98-
# shellcheck disable=SC2076
99-
if [[ "${PR_LABELS}" =~ "\"no-release-notes\"" ]] ; then
93+
if [[ "${PR_LABELS}" == *"no-release-notes"* ]] ; then
10094
echo "Label no-release-notes already present"
10195
else
10296
add_labels+=('no-release-notes')
10397
fi
10498
else
10599
echo "Label to remove: no-release-notes"
106-
# shellcheck disable=SC2076
107-
if [[ "${PR_LABELS}" =~ "\"no-release-notes\"" ]] ; then
100+
if [[ "${PR_LABELS}" == *"no-release-notes"* ]] ; then
108101
remove_labels+=('no-release-notes')
109102
else
110103
echo "Label no-release-notes not present"

0 commit comments

Comments
 (0)