mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 13:38:32 +00:00
c14e30a676
Co-authored-by: Michael Kriese <michael.kriese@visualon.de> Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
25 lines
679 B
TypeScript
25 lines
679 B
TypeScript
import { regEx } from '../../../util/regex';
|
|
import { DockerDatasource } from '../../datasource/docker';
|
|
import type { PackageDependency, PackageFileContent } from '../types';
|
|
|
|
export const pythonRuntimeRegex = regEx(
|
|
'^python-(?<version>\\d+\\.\\d+\\.\\d+)$',
|
|
);
|
|
|
|
export function extractPackageFile(content: string): PackageFileContent | null {
|
|
const regexResult = pythonRuntimeRegex.exec(content);
|
|
const runtimeVersion = regexResult?.groups?.version;
|
|
|
|
if (runtimeVersion) {
|
|
const dep: PackageDependency = {
|
|
depName: 'python',
|
|
currentValue: runtimeVersion,
|
|
datasource: DockerDatasource.id,
|
|
};
|
|
|
|
return { deps: [dep] };
|
|
}
|
|
|
|
return null;
|
|
}
|