mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-31 09:41:46 +00:00
15f4bd8eff
* chore: migrate from zod/v3 to zod/v4 This commit contains the logic changes * chore: migrate imports from zod/v3 to zod/v4 This contains import updates and adds explicit record keys as zod/v4 requires these now * ci: enforce usage of zod/v4
33 lines
987 B
TypeScript
33 lines
987 B
TypeScript
import { z } from 'zod/v4';
|
|
import { filterMap } from '../../../util/filter-map.ts';
|
|
import { Yaml } from '../../../util/schema-utils/index.ts';
|
|
import { parseStep } from './utils.ts';
|
|
|
|
export const BitriseFile = Yaml.pipe(
|
|
z
|
|
.object({
|
|
default_step_lib_source: z.string().optional(),
|
|
workflows: z
|
|
.record(
|
|
z.string(),
|
|
z
|
|
.object({
|
|
steps: z
|
|
.array(
|
|
z
|
|
.record(z.string(), z.unknown())
|
|
.transform((x) => Object.keys(x)),
|
|
)
|
|
.transform((steps) => steps.flat())
|
|
.optional()
|
|
.default([]),
|
|
})
|
|
.transform(({ steps }) => steps),
|
|
)
|
|
.transform((x) => Object.values(x).flat()),
|
|
})
|
|
.transform(({ default_step_lib_source: defaultRegistry, workflows }) =>
|
|
filterMap(workflows, (workflow) => parseStep(workflow, defaultRegistry)),
|
|
),
|
|
);
|