From 718585c0dc7f97488441b3349209697083f6aa4a Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Tue, 20 Mar 2018 15:33:49 +0100 Subject: [PATCH] Match labels without caring about case-sensitivity --- bot/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/index.js b/bot/index.js index f0ce2ca..b53295b 100644 --- a/bot/index.js +++ b/bot/index.js @@ -48,7 +48,8 @@ function getAddress (req) { async function getLabel (req) { const labelNames = await github.getLabels(req) - const bountyLabels = labelNames.filter(labelName => config.bountyLabels.hasOwnProperty(labelName)) + const upperCaseLabelNames = labelNames.map(l => l.toUpperCase()) + const bountyLabels = Object.keys(config.bountyLabels).filter(bountyLabel => upperCaseLabelNames.find(l => l === bountyLabel.toUpperCase())) if (bountyLabels.length === 1) { return bountyLabels[0] }