mirror of
https://github.com/renovatebot/renovate.git
synced 2025-05-13 08:01:49 +00:00
18 lines
479 B
TypeScript
18 lines
479 B
TypeScript
import { logger } from '../../../logger';
|
|
import type { PackageFileContent } from '../types';
|
|
import { BitriseFile } from './schema';
|
|
|
|
export function extractPackageFile(
|
|
content: string,
|
|
packageFile: string,
|
|
): PackageFileContent | null {
|
|
const deps = BitriseFile.catch(({ error: err }) => {
|
|
logger.debug({ err, packageFile }, `Failed to parse Bitrise YAML config`);
|
|
return [];
|
|
}).parse(content);
|
|
|
|
if (!deps.length) {
|
|
return null;
|
|
}
|
|
return { deps };
|
|
}
|