- specify all mapping to lowercase with explicit en locale

This commit is contained in:
Mike Penz
2021-09-14 13:04:50 +02:00
parent 2deff3d4f5
commit 4580067a62
5 changed files with 30 additions and 20 deletions
Generated Vendored
+20 -12
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -129,7 +129,7 @@ const mapPullRequest = (
author: pr.user?.login || '', author: pr.user?.login || '',
repoName: pr.base.repo.full_name, repoName: pr.base.repo.full_name,
labels: new Set( labels: new Set(
pr.labels?.map(lbl => lbl.name?.toLocaleLowerCase() || '') || [] pr.labels?.map(lbl => lbl.name?.toLocaleLowerCase('en') || '') || []
), ),
milestone: pr.milestone?.title || '', milestone: pr.milestone?.title || '',
body: pr.body || '', body: pr.body || '',
+3 -1
View File
@@ -67,7 +67,9 @@ export class Tags {
const length = tags.length const length = tags.length
if (tags.length > 1) { if (tags.length > 1) {
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
if (tags[i].name.toLocaleLowerCase() === tag.toLocaleLowerCase()) { if (
tags[i].name.toLocaleLowerCase('en') === tag.toLocaleLowerCase('en')
) {
if (ignorePreReleases) { if (ignorePreReleases) {
core.info( core.info(
`️ Enabled 'ignorePreReleases', searching for the closest release` `️ Enabled 'ignorePreReleases', searching for the closest release`
+5 -5
View File
@@ -98,7 +98,7 @@ export function buildChangelog(
for (const [pr, body] of transformedMap) { for (const [pr, body] of transformedMap) {
if ( if (
haveCommonElements( haveCommonElements(
ignoredLabels.map(lbl => lbl.toLocaleLowerCase()), ignoredLabels.map(lbl => lbl.toLocaleLowerCase('en')),
pr.labels pr.labels
) )
) { ) {
@@ -111,7 +111,7 @@ export function buildChangelog(
if (category.exhaustive === true) { if (category.exhaustive === true) {
if ( if (
haveEveryElements( haveEveryElements(
category.labels.map(lbl => lbl.toLocaleLowerCase()), category.labels.map(lbl => lbl.toLocaleLowerCase('en')),
pr.labels pr.labels
) )
) { ) {
@@ -121,7 +121,7 @@ export function buildChangelog(
} else { } else {
if ( if (
haveCommonElements( haveCommonElements(
category.labels.map(lbl => lbl.toLocaleLowerCase()), category.labels.map(lbl => lbl.toLocaleLowerCase('en')),
pr.labels pr.labels
) )
) { ) {
@@ -344,12 +344,12 @@ function extractValues(
if (extractor.method === 'match') { if (extractor.method === 'match') {
const lables = onValue.match(extractor.pattern) const lables = onValue.match(extractor.pattern)
if (lables !== null) { if (lables !== null) {
return lables.map(label => label.toLocaleLowerCase()) return lables.map(label => label.toLocaleLowerCase('en'))
} }
} else { } else {
const label = onValue.replace(extractor.pattern, extractor.target) const label = onValue.replace(extractor.pattern, extractor.target)
if (label !== '') { if (label !== '') {
return [label.toLocaleLowerCase()] return [label.toLocaleLowerCase('en')]
} }
} }
return null return null