fix: fail to search by excluding labels with capital letter (#400)

* fix: fail to search by excluding labels with capital letter

* make all the excluded labels lowcased

* Revert "make all the excluded labels lowcased"

This reverts commit 866bed4080.
This commit is contained in:
Hongbo Wu 2022-04-11 14:05:21 +08:00 committed by GitHub
parent fb24d6d9ad
commit b4420839bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,18 +98,15 @@ const parseLabelFilter = (
return undefined
}
// use lower case for label names
const labels = str.toLocaleLowerCase().split(',')
const labels = str.split(',')
// check if the labels are in the exclude list
const excluded =
exclude &&
exclude.label &&
labels.every((label) => exclude.label.includes(label))
// check if the labels are on the exclusion list
const excluded = exclude?.label && exclude.label.includes(...labels)
return {
type: excluded ? LabelFilterType.EXCLUDE : LabelFilterType.INCLUDE,
labels,
// use lower case for label names
labels: labels.map((label) => label.toLowerCase()),
}
}