mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-04 20:42:52 +00:00
@@ -483,13 +483,28 @@ export function checkContributors(path: PathLike, packageJson: PackageJSON): voi
|
||||
* @param path Path to CI config
|
||||
*/
|
||||
export function checkCIConfig(rules: Rules, path: string): void {
|
||||
// check CI config if it exists
|
||||
const pathToCiConfig = resolve(path, '.gitlab-ci.yml');
|
||||
|
||||
// check CI config if it exists
|
||||
if (existsSync(pathToCiConfig)) {
|
||||
// read CI config
|
||||
const buffer = readFileSync(pathToCiConfig);
|
||||
const content = readFileSync(pathToCiConfig)
|
||||
.toString();
|
||||
|
||||
let ciConfigWithoutTemplates = '';
|
||||
|
||||
for (const line of content.split('\n')) {
|
||||
const match = line
|
||||
.trim()
|
||||
.match(/^<</);
|
||||
|
||||
if (match === null) {
|
||||
ciConfigWithoutTemplates += `${line}\n`;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const ciConfig = parse(buffer.toString());
|
||||
const ciConfig = parse(ciConfigWithoutTemplates);
|
||||
|
||||
// check entries
|
||||
for (const entry in rules.ciConfig) {
|
||||
|
||||
Reference in New Issue
Block a user