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 absoluteFileDirname = path.resolve(path.dirname(file));
const relativeFileDirname = absoluteFileDirname.slice(absoluteParentFolder.length + 1); const relativeFileDirname = absoluteFileDirname.slice(absoluteParentFolder.length + 1);
const chartPathParts = relativeFileDirname.split("/"); const chartPathParts = relativeFileDirname.split("/");
const chart = `${chartPathParts[0]}/${chartPathParts[1]}`; const chartType = chartPathParts[0];
changedCharts.push(chart); const chartName = chartPathParts[1];
if (chartType && chartName) {
changedCharts.push(`${chartType}/${chartName}`);
}
}); });
// Return only unique items // Return only unique items
return changedCharts.filter((item, index) => changedCharts.indexOf(item) === index); return changedCharts.filter((item, index) => changedCharts.indexOf(item) === index);

File diff suppressed because one or more lines are too long

View file

@ -12,13 +12,11 @@
"@actions/core": "^1.9.0", "@actions/core": "^1.9.0",
"@actions/github": "^5.0.3", "@actions/github": "^5.0.3",
"fs-extra": "^10.1.0", "fs-extra": "^10.1.0",
"semver": "^7.3.7",
"yaml": "^2.1.1" "yaml": "^2.1.1"
}, },
"devDependencies": { "devDependencies": {
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^9.0.13",
"@types/node": "^17.0.21", "@types/node": "^17.0.21",
"@types/semver": "^7.3.10",
"@vercel/ncc": "^0.31.1", "@vercel/ncc": "^0.31.1",
"typescript": "^4.6.2" "typescript": "^4.6.2"
} }
@ -166,12 +164,6 @@
"integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==",
"dev": true "dev": true
}, },
"node_modules/@types/semver": {
"version": "7.3.10",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.10.tgz",
"integrity": "sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw==",
"dev": true
},
"node_modules/@vercel/ncc": { "node_modules/@vercel/ncc": {
"version": "0.31.1", "version": "0.31.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.31.1.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.31.1.tgz",
@ -228,17 +220,6 @@
"graceful-fs": "^4.1.6" "graceful-fs": "^4.1.6"
} }
}, },
"node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/node-fetch": { "node_modules/node-fetch": {
"version": "2.6.7", "version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
@ -266,20 +247,6 @@
"wrappy": "1" "wrappy": "1"
} }
}, },
"node_modules/semver": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/tr46": { "node_modules/tr46": {
"version": "0.0.3", "version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
@ -338,11 +305,6 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
}, },
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"node_modules/yaml": { "node_modules/yaml": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz",
@ -490,12 +452,6 @@
"integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==",
"dev": true "dev": true
}, },
"@types/semver": {
"version": "7.3.10",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.10.tgz",
"integrity": "sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw==",
"dev": true
},
"@vercel/ncc": { "@vercel/ncc": {
"version": "0.31.1", "version": "0.31.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.31.1.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.31.1.tgz",
@ -541,14 +497,6 @@
"universalify": "^2.0.0" "universalify": "^2.0.0"
} }
}, },
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"node-fetch": { "node-fetch": {
"version": "2.6.7", "version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
@ -565,14 +513,6 @@
"wrappy": "1" "wrappy": "1"
} }
}, },
"semver": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
"requires": {
"lru-cache": "^6.0.0"
}
},
"tr46": { "tr46": {
"version": "0.0.3", "version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
@ -618,11 +558,6 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
}, },
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"yaml": { "yaml": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz",

View file

@ -107,9 +107,12 @@ function filterChangedCharts(files: string[], parentFolder: string) {
const relativeFileDirname = absoluteFileDirname.slice( const relativeFileDirname = absoluteFileDirname.slice(
absoluteParentFolder.length + 1 absoluteParentFolder.length + 1
); );
const chartPathParts = relativeFileDirname.split("/"); const chartPathParts: string[] = relativeFileDirname.split("/");
const chart = `${chartPathParts[0]}/${chartPathParts[1]}`; const chartType: string = chartPathParts[0];
changedCharts.push(chart); const chartName: string = chartPathParts[1];
if (chartType && chartName) {
changedCharts.push(`${chartType}/${chartName}`);
}
}); });
// Return only unique items // Return only unique items