mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-25 23:11:31 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
26 lines
675 B
TypeScript
26 lines
675 B
TypeScript
import { logger } from '../../../logger/index.ts';
|
|
import { getDep } from '../dockerfile/extract.ts';
|
|
import type { PackageFileContent } from '../types.ts';
|
|
import { CloudbuildSteps } from './schema.ts';
|
|
|
|
export function extractPackageFile(
|
|
content: string,
|
|
packageFile?: string,
|
|
): PackageFileContent | null {
|
|
const deps = CloudbuildSteps.catch(({ error: err }) => {
|
|
logger.debug(
|
|
{ err, packageFile },
|
|
'Cloud Build: error extracting Docker images from a configuration file.',
|
|
);
|
|
return [];
|
|
})
|
|
.transform((steps) => steps.map((step) => getDep(step)))
|
|
.parse(content);
|
|
|
|
if (!deps.length) {
|
|
return null;
|
|
}
|
|
|
|
return { deps };
|
|
}
|