- use toLocaleLowerCase to ensure we have proper locale dependent lowercase behavior

- ensure we also match the configuration case independent
This commit is contained in:
Mike Penz
2021-06-23 11:54:45 +02:00
parent 49aee4dc11
commit 4d47219031
5 changed files with 21 additions and 11 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ const mapPullRequest = (
repoName: pr.base.repo.full_name,
labels: new Set(
pr.labels?.map(function (label) {
return label.name?.toLowerCase() || ''
return label.name?.toLocaleLowerCase() || ''
}) || []
),
milestone: pr.milestone?.title || '',
+1 -1
View File
@@ -65,7 +65,7 @@ export class Tags {
try {
const length = tags.length
for (let i = 0; i < length; i++) {
if (tags[i].name.toLowerCase() === tag.toLowerCase()) {
if (tags[i].name.toLocaleLowerCase() === tag.toLocaleLowerCase()) {
if (ignorePreReleases) {
core.info(
`️ Enabled 'ignorePreReleases', searching for the closest release`
+13 -3
View File
@@ -39,7 +39,7 @@ export function buildChangelog(
label = pr.body.replace(extractor.pattern, extractor.target)
}
if (label !== '') {
pr.labels.add(label.toLowerCase())
pr.labels.add(label.toLocaleLowerCase())
}
}
}
@@ -81,14 +81,24 @@ export function buildChangelog(
// bring elements in order
for (const [pr, body] of transformedMap) {
if (haveCommonElements(ignoredLabels, pr.labels)) {
if (
haveCommonElements(
ignoredLabels.map(lbl => lbl.toLocaleLowerCase()),
pr.labels
)
) {
ignoredPrs.push(body)
continue
}
let matched = false
for (const [category, pullRequests] of categorized) {
if (haveCommonElements(category.labels, pr.labels)) {
if (
haveCommonElements(
category.labels.map(lbl => lbl.toLocaleLowerCase()),
pr.labels
)
) {
pullRequests.push(body)
matched = true
}