ci: Make sure to only include proper chart folders

This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2022-08-07 15:32:24 +02:00
parent 435c6097f0
commit 155946fb1e
No known key found for this signature in database
GPG key ID: BC5E2BD907F9A8EC
4 changed files with 12 additions and 71 deletions

View file

@ -126,8 +126,11 @@ function filterChangedCharts(files, parentFolder) {
const absoluteFileDirname = path.resolve(path.dirname(file));
const relativeFileDirname = absoluteFileDirname.slice(absoluteParentFolder.length + 1);
const chartPathParts = relativeFileDirname.split("/");
const chart = `${chartPathParts[0]}/${chartPathParts[1]}`;
changedCharts.push(chart);
const chartType = chartPathParts[0];
const chartName = chartPathParts[1];
if (chartType && chartName) {
changedCharts.push(`${chartType}/${chartName}`);
}
});
// Return only unique items
return changedCharts.filter((item, index) => changedCharts.indexOf(item) === index);