Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate types from the Github Actions JSON schema #43

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions workflows/cmd/generate-config-schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as fs from "fs";
import zodToJsonSchema from "zod-to-json-schema";
import { Config } from "../src/config";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be easy to add (a version of) this file to the PR? So we can see what sort of things would be written to the schema?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tenwit I think I committed this file too early. It should have been part of the next PR, together with the schema config file you ask for, where I would go into reading a repository specific config file, with schema validation.


const schema = zodToJsonSchema(Config, "ci-config");

fs.writeFileSync("config-schema.json", JSON.stringify(schema, null, 2));
Loading