Skip to content
Snippets Groups Projects
Unverified Commit 1c82ddec authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

refactor(bitrise): Simplify file parsing usage (#33525)

parent 6ff935ef
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,6 @@ import { parseGitUrl } from '../../../util/git/url';
import { GithubHttp } from '../../../util/http/github';
import { fromBase64 } from '../../../util/string';
import { joinUrlParts } from '../../../util/url';
import { parseSingleYaml } from '../../../util/yaml';
import { GithubContentResponse } from '../../platform/github/schema';
import semver from '../../versioning/semver';
import { Datasource } from '../datasource';
......@@ -111,9 +110,7 @@ export class BitriseDatasource extends Datasource {
}
const content = fromBase64(body.content);
const { published_at, source_code_url } = parseSingleYaml(content, {
customSchema: BitriseStepFile,
});
const { published_at, source_code_url } = BitriseStepFile.parse(content);
result.releases.push({
version: versionDir.name,
......
import { z } from 'zod';
import { Yaml } from '../../../util/schema-utils';
export const BitriseStepFile = z.object({
published_at: z.string(),
source_code_url: z.string().optional(),
});
export const BitriseStepFile = Yaml.pipe(
z.object({
published_at: z.string(),
source_code_url: z.string().optional(),
}),
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment