Merge pull request #29 from schalkneethling/10-unhandled-promise-rejection-warning

fix:action lower case strings before comparing
This commit is contained in:
Benjamin Lannon 2022-03-05 10:50:10 -05:00 committed by GitHub
commit 29460174a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,7 +88,9 @@ function diffLabels(oldLabels, newLabels) {
let labelModList = [];
oldLabelsNames.forEach(oLabel => {
if (newLabelsNames.includes(oLabel)) {
// when using `includes` with strings, the match is case-sensitive
// so we first lowercase both strings when comparing
if (newLabelsNames.toLowerCase().includes(oLabel.toLowerCase())) {
const oldLabel = oldLabels.filter(l => l.name === oLabel)[0];
const newLabel = newLabels.filter(l => l.name === oLabel)[0];