Skip to content

Commit 891ac86

Browse files
lionsealjohnlk
andauthored
add: -w to match the whole label (#65)
Co-authored-by: John Kuhn <[email protected]>
1 parent f2aafc4 commit 891ac86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/github.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ github::add_label_to_pr() {
5555
local -r xl_label="${7}"
5656

5757
local -r body=$(curl -sSL -H "Authorization: token $GITHUB_TOKEN" -H "$GITHUB_API_HEADER" "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls/$pr_number")
58-
local labels=$(echo "$body" | jq .labels | jq -r ".[] | .name" | grep -e "$xs_label" -e "$s_label" -e "$m_label" -e "$l_label" -e "$xl_label" -v)
58+
local labels=$(echo "$body" | jq .labels | jq -r ".[] | .name" | grep -w -e "$xs_label" -e "$s_label" -e "$m_label" -e "$l_label" -e "$xl_label" -v)
5959
labels=$(printf "%s\n%s" "$labels" "$label_to_add")
6060
local -r comma_separated_labels=$(github::format_labels "$labels")
6161

0 commit comments

Comments
 (0)