MCPcopy Create free account
hub / github.com/github/gh-aw / getCompiledSchema

Function getCompiledSchema

pkg/workflow/schema_validation.go:61–74  ·  view source on GitHub ↗

getCompiledSchema returns the compiled GitHub Actions schema, compiling it once and caching

()

Source from the content-addressed store, hash-verified

59
60// getCompiledSchema returns the compiled GitHub Actions schema, compiling it once and caching
61func getCompiledSchema() (*jsonschema.Schema, error) {
62 compiledSchemaOnce.Do(func() {
63 schemaValidationLog.Print("Compiling GitHub Actions schema (first time)")
64 compiledSchema, schemaCompileError = compileSchema(
65 githubWorkflowSchema,
66 "https://json.schemastore.org/github-workflow.json",
67 )
68 if schemaCompileError == nil {
69 schemaValidationLog.Print("GitHub Actions schema compiled successfully")
70 }
71 })
72
73 return compiledSchema, schemaCompileError
74}
75
76// validateGitHubActionsSchema validates the generated YAML content against the GitHub Actions workflow schema
77func (c *Compiler) validateGitHubActionsSchema(yamlContent string) error {

Calls 2

PrintMethod · 0.80
compileSchemaFunction · 0.70

Tested by

no test coverage detected