Skip to content

Commit

Permalink
add: -w to match the whole label (#65)
Browse files Browse the repository at this point in the history
Co-authored-by: John Kuhn <john@useintegral.com>
  • Loading branch information
lionseal and johnlk committed Apr 16, 2024
1 parent f2aafc4 commit 891ac86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ github::add_label_to_pr() {
local -r xl_label="${7}"

local -r body=$(curl -sSL -H "Authorization: token $GITHUB_TOKEN" -H "$GITHUB_API_HEADER" "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls/$pr_number")
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)
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)
labels=$(printf "%s\n%s" "$labels" "$label_to_add")
local -r comma_separated_labels=$(github::format_labels "$labels")

Expand Down

0 comments on commit 891ac86

Please sign in to comment.