ci(danger): Changed pattern for matching area labels

This commit is contained in:
Tomas Sebestik 2023-03-30 11:23:41 +02:00
parent 893d6ad5aa
commit c1d5514a4e

View File

@ -5,10 +5,10 @@
*/
module.exports = async function () {
const projectId = 103; // ESP-IDF
const areaLabelColor = "#d2eBFA";
const areaLabelColor = /^#d2ebfa$/i; // match color code (case-insensitive)
const projectLabels = await danger.gitlab.api.Labels.all(projectId); // Get all project labels
const areaLabels = projectLabels
.filter((label) => label.color === areaLabelColor)
.filter((label) => areaLabelColor.test(label.color))
.map((label) => label.name); // Filter only area labels
const mrLabels = danger.gitlab.mr.labels; // Get MR labels