Merge pull request #29 from schalkneethling/10-unhandled-promise-rejection-warning
fix:action lower case strings before comparing
This commit is contained in:
commit
29460174a9
1 changed files with 3 additions and 1 deletions
4
index.js
4
index.js
|
@ -88,7 +88,9 @@ function diffLabels(oldLabels, newLabels) {
|
||||||
let labelModList = [];
|
let labelModList = [];
|
||||||
|
|
||||||
oldLabelsNames.forEach(oLabel => {
|
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 oldLabel = oldLabels.filter(l => l.name === oLabel)[0];
|
||||||
const newLabel = newLabels.filter(l => l.name === oLabel)[0];
|
const newLabel = newLabels.filter(l => l.name === oLabel)[0];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue