diff --git a/pkg/3rdparty/jsonschema/draft2019_09_keywords.go b/pkg/3rdparty/jsonschema/draft2019_09_keywords.go index 1858b711..f670fee6 100644 --- a/pkg/3rdparty/jsonschema/draft2019_09_keywords.go +++ b/pkg/3rdparty/jsonschema/draft2019_09_keywords.go @@ -48,6 +48,8 @@ func LoadDraft2019_09() { RegisterKeyword("oneOf", NewOneOf) RegisterKeyword("not", NewNot) + SetKeywordOrder("allOf", -1) + // object Keywords RegisterKeyword("properties", NewProperties) RegisterKeyword("patternProperties", NewPatternProperties) diff --git a/pkg/3rdparty/jsonschema/keywords_core.go b/pkg/3rdparty/jsonschema/keywords_core.go index bb5d04ac..4670d59c 100644 --- a/pkg/3rdparty/jsonschema/keywords_core.go +++ b/pkg/3rdparty/jsonschema/keywords_core.go @@ -228,6 +228,14 @@ func NewRef() Keyword { return new(Ref) } +// ResolveRef attempts to resolve the reference and return the resolved schema +func (r *Ref) ResolveRef(rootSchema *Schema) *Schema { + if r.resolved == nil { + r._resolveRef(context.Background(), NewValidationState(rootSchema)) + } + return r.resolved +} + // ValidateKeyword implements the Keyword interface for Ref func (r *Ref) ValidateKeyword(ctx context.Context, currentState *ValidationState, data interface{}) { schemaDebug("[Ref] Validating") diff --git a/pkg/3rdparty/jsonschema/keywords_object.go b/pkg/3rdparty/jsonschema/keywords_object.go index d38907a9..b727d6ac 100644 --- a/pkg/3rdparty/jsonschema/keywords_object.go +++ b/pkg/3rdparty/jsonschema/keywords_object.go @@ -4,10 +4,12 @@ import ( "context" "encoding/json" "fmt" - orderedmap "github.com/wk8/go-ordered-map/v2" "regexp" + "sort" "strconv" + orderedmap "github.com/wk8/go-ordered-map/v2" + jptr "github.com/qri-io/jsonpointer" ) @@ -214,15 +216,15 @@ func NewPatternProperties() Keyword { } type patternSchema struct { - key string - re *regexp.Regexp - schema *Schema + Key string + Re *regexp.Regexp + Schema *Schema } // Register implements the Keyword interface for PatternProperties func (p *PatternProperties) Register(uri string, registry *SchemaRegistry) { for _, v := range *p { - v.schema.Register(uri, registry) + v.Schema.Register(uri, registry) } } @@ -239,13 +241,13 @@ func (p *PatternProperties) Resolve(pointer jptr.Pointer, uri string) *Schema { patProp := &patternSchema{} for _, v := range *p { - if v.key == *current { + if v.Key == *current { patProp = &v break } } - return patProp.schema.Resolve(pointer.Tail(), uri) + return patProp.Schema.Resolve(pointer.Tail(), uri) } // ValidateKeyword implements the Keyword interface for PatternProperties @@ -254,7 +256,7 @@ func (p PatternProperties) ValidateKeyword(ctx context.Context, currentState *Va if obj, ok := data.(map[string]interface{}); ok { for key, val := range obj { for _, ptn := range p { - if ptn.re.Match([]byte(key)) { + if ptn.Re.Match([]byte(key)) { currentState.SetEvaluatedKey(key) subState := currentState.NewSubState() subState.DescendBase("patternProperties", key) @@ -262,7 +264,7 @@ func (p PatternProperties) ValidateKeyword(ctx context.Context, currentState *Va subState.DescendInstance(key) subState.Errs = &[]KeyError{} - ptn.schema.ValidateKeyword(ctx, subState, val) + ptn.Schema.ValidateKeyword(ctx, subState, val) currentState.AddSubErrors(*subState.Errs...) if subState.IsValid() { @@ -277,8 +279,8 @@ func (p PatternProperties) ValidateKeyword(ctx context.Context, currentState *Va // JSONProp implements the JSONPather for PatternProperties func (p PatternProperties) JSONProp(name string) interface{} { for _, pp := range p { - if pp.key == name { - return pp.schema + if pp.Key == name { + return pp.Schema } } return nil @@ -288,7 +290,7 @@ func (p PatternProperties) JSONProp(name string) interface{} { func (p PatternProperties) JSONChildren() (res map[string]JSONPather) { res = map[string]JSONPather{} for i, pp := range p { - res[strconv.Itoa(i)] = pp.schema + res[strconv.Itoa(i)] = pp.Schema } return } @@ -308,13 +310,16 @@ func (p *PatternProperties) UnmarshalJSON(data []byte) error { return fmt.Errorf("invalid pattern: %s: %s", key, err.Error()) } ptn[i] = patternSchema{ - key: key, - re: re, - schema: sch, + Key: key, + Re: re, + Schema: sch, } i++ } + sort.Slice(ptn, func(i, j int) bool { + return ptn[i].Key < ptn[j].Key + }) *p = ptn return nil } @@ -323,7 +328,7 @@ func (p *PatternProperties) UnmarshalJSON(data []byte) error { func (p PatternProperties) MarshalJSON() ([]byte, error) { obj := map[string]interface{}{} for _, prop := range p { - obj[prop.key] = prop.schema + obj[prop.Key] = prop.Schema } return json.Marshal(obj) } diff --git a/pkg/tools/gen/genkcl_jsonschema.go b/pkg/tools/gen/genkcl_jsonschema.go index 78e3a3f6..293dfced 100644 --- a/pkg/tools/gen/genkcl_jsonschema.go +++ b/pkg/tools/gen/genkcl_jsonschema.go @@ -1,11 +1,12 @@ package gen import ( - "context" "encoding/json" "io" "path/filepath" + "reflect" "regexp" + "sort" "strconv" "strings" @@ -15,9 +16,13 @@ import ( ) type convertContext struct { - imports map[string]struct{} - resultMap map[string]convertResult - paths []string + rootSchema *jsonschema.Schema + imports map[string]struct{} + resultMap map[string]convertResult + paths []string + // pathObjects is used to avoid infinite loop when converting recursive schema + // TODO: support recursive schema + pathObjects []*jsonschema.Schema } type convertResult struct { @@ -37,14 +42,14 @@ func (k *kclGenerator) genSchemaFromJsonSchema(w io.Writer, filename string, src if err = js.UnmarshalJSON(code); err != nil { return err } - // use Validate to trigger the evaluation of json schema - js.Validate(context.Background(), nil) // convert json schema to kcl schema ctx := convertContext{ - resultMap: make(map[string]convertResult), - imports: make(map[string]struct{}), - paths: []string{}, + rootSchema: js, + resultMap: make(map[string]convertResult), + imports: make(map[string]struct{}), + paths: []string{}, + pathObjects: []*jsonschema.Schema{}, } result := convertSchemaFromJsonSchema(&ctx, js, strings.TrimSuffix(filepath.Base(filename), filepath.Ext(filename))) @@ -86,12 +91,22 @@ func convertSchemaFromJsonSchema(ctx *convertContext, s *jsonschema.Schema, name name = "MyType" } result := convertResult{IsSchema: false, Name: name} + if objectExists(ctx.pathObjects, s) { + result.Type = typePrimitive(typAny) + return result + } ctx.paths = append(ctx.paths, name) + ctx.pathObjects = append(ctx.pathObjects, s) + defer func() { + ctx.paths = ctx.paths[:len(ctx.paths)-1] + ctx.pathObjects = ctx.pathObjects[:len(ctx.pathObjects)-1] + }() isArray := false typeList := typeUnion{} required := make(map[string]struct{}) - for _, k := range s.OrderedKeywords { + for i := 0; i < len(s.OrderedKeywords); i++ { + k := s.OrderedKeywords[i] switch v := s.Keywords[k].(type) { case *jsonschema.Title: case *jsonschema.Comment: @@ -130,6 +145,7 @@ func convertSchemaFromJsonSchema(ctx *convertContext, s *jsonschema.Schema, name required[key] = struct{}{} } case *jsonschema.Properties: + result.IsSchema = true for _, prop := range *v { key := prop.Key val := prop.Value @@ -146,6 +162,38 @@ func convertSchemaFromJsonSchema(ctx *convertContext, s *jsonschema.Schema, name } } } + case *jsonschema.PatternProperties: + result.IsSchema = true + canConvert := true + if result.HasIndexSignature { + canConvert = false + logger.GetLogger().Warningf("failed to convert patternProperties: already has index signature.") + } + if len(*v) != 1 { + canConvert = false + logger.GetLogger().Warningf("unsupported multiple patternProperties.") + } + result.HasIndexSignature = true + result.IndexSignature = indexSignature{ + Type: typePrimitive(typAny), + } + for i, prop := range *v { + val := prop.Schema + propSch := convertSchemaFromJsonSchema(ctx, val, "patternProperties" + strconv.Itoa(i)) + if propSch.IsSchema { + ctx.resultMap[propSch.schema.Name] = propSch + } + if canConvert { + result.IndexSignature = indexSignature{ + Alias: "key", + Type: propSch.property.Type, + validation: &validation{ + Name: "key", + Regex: prop.Re, + }, + } + } + } case *jsonschema.Default: result.HasDefault = true result.DefaultValue = v.Data @@ -172,35 +220,62 @@ func convertSchemaFromJsonSchema(ctx *convertContext, s *jsonschema.Schema, name typeList.Items = []typeInterface{typeValue{Value: unmarshalledVal}} result.HasDefault = true result.DefaultValue = unmarshalledVal - case *jsonschema.Ref: - typeName := strcase.ToCamel(v.Reference[strings.LastIndex(v.Reference, "/")+1:]) - typeList.Items = []typeInterface{typeCustom{Name: typeName}} case *jsonschema.Defs: - paths := ctx.paths - ctx.paths = []string{} - for key, val := range *v { - sch := convertSchemaFromJsonSchema(ctx, val, key) - if !sch.IsSchema { - logger.GetLogger().Warningf("unsupported defining non-object: %s", key) - sch = convertResult{ - IsSchema: true, - Name: key, - schema: schema{ - Name: strcase.ToCamel(key), - HasIndexSignature: true, - IndexSignature: indexSignature{ - Type: typePrimitive(typAny), - }, - }, + case *jsonschema.Ref: + refSch := v.ResolveRef(ctx.rootSchema) + if refSch == nil || refSch.OrderedKeywords == nil { + logger.GetLogger().Warningf("failed to resolve ref: %s", v.Reference) + continue + } + schs := []*jsonschema.Schema{refSch} + for i := 0; i < len(schs); i++ { + sch := schs[i] + for _, key := range sch.OrderedKeywords { + if _, ok := s.Keywords[key]; !ok { + s.OrderedKeywords = append(s.OrderedKeywords, key) + s.Keywords[key] = sch.Keywords[key] + } else { + switch v := sch.Keywords[key].(type) { + case *jsonschema.Type: + case *jsonschema.Description: + case *jsonschema.Comment: + case *jsonschema.Ref: + refSch := v.ResolveRef(ctx.rootSchema) + if refSch == nil || refSch.OrderedKeywords == nil { + logger.GetLogger().Warningf("failed to resolve ref: %s.", v.Reference) + continue + } + schs = append(schs, refSch) + case *jsonschema.Properties: + props := *s.Keywords[key].(*jsonschema.Properties) + props = append(props, *v...) + s.Keywords[key] = &props + case *jsonschema.Required: + reqs := *s.Keywords[key].(*jsonschema.Required) + reqs = append(reqs, *v...) + s.Keywords[key] = &reqs + case *jsonschema.Items: + items := *s.Keywords[key].(*jsonschema.Items) + items.Schemas = append(items.Schemas, v.Schemas...) + s.Keywords[key] = &items + case *jsonschema.MinItems: + case *jsonschema.Pattern: + default: + logger.GetLogger().Warningf("failed to merge ref: unsupported keyword %s. Paths: %s", key, strings.Join(ctx.paths, "/")) + } } } - ctx.resultMap[key] = sch } - ctx.paths = paths + sort.SliceStable(s.OrderedKeywords[i+1:], func(i, j int) bool { + return jsonschema.GetKeywordOrder(s.OrderedKeywords[i]) < jsonschema.GetKeywordOrder(s.OrderedKeywords[j]) + }) case *jsonschema.AdditionalProperties: switch v.SchemaType { case jsonschema.SchemaTypeObject: sch := convertSchemaFromJsonSchema(ctx, (*jsonschema.Schema)(v), "additionalProperties") + if sch.IsSchema { + ctx.resultMap[sch.schema.Name] = sch + } result.HasIndexSignature = true result.IndexSignature = indexSignature{ Type: sch.Type, @@ -211,7 +286,6 @@ func convertSchemaFromJsonSchema(ctx *convertContext, s *jsonschema.Schema, name Type: typePrimitive(typAny), } case jsonschema.SchemaTypeFalse: - result.HasIndexSignature = false } case *jsonschema.Minimum: result.Validations = append(result.Validations, validation{ @@ -269,6 +343,51 @@ func convertSchemaFromJsonSchema(ctx *convertContext, s *jsonschema.Schema, name result.Validations = append(result.Validations, validation{ MaxLength: (*int)(v), }) + case *jsonschema.OneOf: + for i, val := range *v { + item := convertSchemaFromJsonSchema(ctx, val, "oneOf"+strconv.Itoa(i)) + if item.IsSchema { + ctx.resultMap[item.schema.Name] = item + typeList.Items = append(typeList.Items, typeCustom{Name: item.schema.Name}) + } else { + typeList.Items = append(typeList.Items, item.Type) + } + } + case *jsonschema.AllOf: + schs := *v + for i := 0; i < len(schs); i++ { + sch := schs[i] + for _, key := range sch.OrderedKeywords { + if _, ok := s.Keywords[key]; !ok { + s.OrderedKeywords = append(s.OrderedKeywords, key) + s.Keywords[key] = sch.Keywords[key] + } else { + switch v := sch.Keywords[key].(type) { + case *jsonschema.Type: + case *jsonschema.Ref: + refSch := v.ResolveRef(ctx.rootSchema) + if refSch == nil || refSch.OrderedKeywords == nil { + logger.GetLogger().Warningf("failed to resolve ref: %s", v.Reference) + continue + } + schs = append(schs, refSch) + case *jsonschema.Properties: + props := *s.Keywords[key].(*jsonschema.Properties) + props = append(props, *v...) + s.Keywords[key] = &props + case *jsonschema.Required: + reqs := *s.Keywords[key].(*jsonschema.Required) + reqs = append(reqs, *v...) + s.Keywords[key] = &reqs + default: + logger.GetLogger().Warningf("failed to merge allOf: unsupported keyword %s", key) + } + } + } + } + sort.SliceStable(s.OrderedKeywords[i+1:], func(i, j int) bool { + return jsonschema.GetKeywordOrder(s.OrderedKeywords[i]) < jsonschema.GetKeywordOrder(s.OrderedKeywords[j]) + }) default: logger.GetLogger().Warningf("unknown Keyword: %s", k) } @@ -281,25 +400,27 @@ func convertSchemaFromJsonSchema(ctx *convertContext, s *jsonschema.Schema, name } result.schema.Name = s.String() result.schema.Description = result.Description - result.Type = typeCustom{Name: strcase.ToCamel(result.schema.Name)} + typeList.Items = append(typeList.Items, typeCustom{Name: result.schema.Name}) if len(result.Properties) == 0 && !result.HasIndexSignature { result.HasIndexSignature = true result.IndexSignature = indexSignature{Type: typePrimitive(typAny)} } - } else { - if len(typeList.Items) != 0 { - if isArray { - result.Type = typeArray{Items: typeList} - } else { - result.Type = typeList - } + } + if len(typeList.Items) != 0 { + if isArray { + result.Type = typeArray{Items: typeList} } else { - result.Type = typePrimitive(typAny) + result.Type = typeList } + } else { + result.Type = typePrimitive(typAny) + } + + if result.HasIndexSignature && result.IndexSignature.validation != nil { + result.Validations = append(result.Validations, *result.IndexSignature.validation) } result.property.Name = strcase.ToSnake(result.Name) result.property.Description = result.Description - ctx.paths = ctx.paths[:len(ctx.paths)-1] return result } @@ -326,3 +447,12 @@ func jsonTypeToKclType(t string) typeInterface { return typePrimitive(typStr) } } + +func objectExists(objs []*jsonschema.Schema, obj *jsonschema.Schema) bool { + for _, o := range objs { + if reflect.DeepEqual(o, obj) { + return true + } + } + return false +} diff --git a/pkg/tools/gen/template.go b/pkg/tools/gen/template.go index 93d5664c..560d3ef2 100644 --- a/pkg/tools/gen/template.go +++ b/pkg/tools/gen/template.go @@ -103,6 +103,15 @@ func formatValue(v interface{}) string { s.WriteString(fmt.Sprintf("%s: %s", formatValue(key), formatValue(value[key]))) } return "{" + s.String() + "}" + case []interface{}: + var s strings.Builder + for i, item := range value { + if i != 0 { + s.WriteString(", ") + } + s.WriteString(formatValue(item)) + } + return "[" + s.String() + "]" default: return fmt.Sprintf("%v", value) } diff --git a/pkg/tools/gen/templates/kcl/schema.gotmpl b/pkg/tools/gen/templates/kcl/schema.gotmpl index e726bb83..f10eb9ef 100644 --- a/pkg/tools/gen/templates/kcl/schema.gotmpl +++ b/pkg/tools/gen/templates/kcl/schema.gotmpl @@ -7,8 +7,8 @@ schema {{ formatName .Name }}: {{ formatName .Name }}{{ if not .Required }}?{{ end }}: {{ formatType .Type }}{{ if .HasDefault }} = {{ formatValue .DefaultValue }}{{ end }} {{- end }} {{- if .HasIndexSignature }}{{- "\n [" }} - {{- if .IndexSignature.Alias }}{{ formatName .IndexSignature.Alias }}:{{ end }} - {{- "...str]: " }}{{ formatType .IndexSignature.Type }} + {{- if .IndexSignature.Alias }}{{ formatName .IndexSignature.Alias }}: {{ else }}...{{ end }} + {{- "str]: " }}{{ formatType .IndexSignature.Type }} {{- end }} {{- if .Validations }} diff --git a/pkg/tools/gen/testdata/jsonschema/allof/expect.k b/pkg/tools/gen/testdata/jsonschema/allof/expect.k new file mode 100644 index 00000000..772cbb03 --- /dev/null +++ b/pkg/tools/gen/testdata/jsonschema/allof/expect.k @@ -0,0 +1,57 @@ +""" +This file was generated by the KCL auto-gen tool. DO NOT EDIT. +Editing this file might prove futile when you re-run the KCL auto-gen generate command. +""" + +schema Shop: + r""" + Schema for representing a shop information. + In this test case, we use some logic keywords like "oneOf" that can't be directly converted at the moment. To make it still work, we'll convert it into "any" type. + + Attributes + ---------- + products : ShopProductsOneOf0 | [ShopProductsOneOf1Items0] | "empty", optional + """ + + products?: ShopProductsOneOf0 | [ShopProductsOneOf1Items0] | "empty" + +schema ShopProductsOneOf0: + r""" + ShopProductsOneOf0 + + Attributes + ---------- + type : "clothing", required, default is "clothing" + material : str, optional + name : str, required + price : float, optional + """ + + type: "clothing" = "clothing" + material?: str + name: str + price?: float + + check: + price >= 0 + +schema ShopProductsOneOf1Items0: + r""" + ShopProductsOneOf1Items0 + + Attributes + ---------- + type : "clothing", required, default is "clothing" + material : str, optional + name : str, required + price : float, optional + """ + + type: "clothing" = "clothing" + material?: str + name: str + price?: float + + check: + price >= 0 + diff --git a/pkg/tools/gen/testdata/jsonschema/unsupport/input.json b/pkg/tools/gen/testdata/jsonschema/allof/input.json similarity index 90% rename from pkg/tools/gen/testdata/jsonschema/unsupport/input.json rename to pkg/tools/gen/testdata/jsonschema/allof/input.json index df5a5a81..08f943e6 100644 --- a/pkg/tools/gen/testdata/jsonschema/unsupport/input.json +++ b/pkg/tools/gen/testdata/jsonschema/allof/input.json @@ -13,7 +13,10 @@ "type": "number", "minimum": 0 } - } + }, + "required": [ + "name" + ] }, "clothing": { "allOf": [ @@ -29,7 +32,10 @@ "material": { "type": "string" } - } + }, + "required": [ + "type" + ] } ] } @@ -53,4 +59,4 @@ ] } } -} +} \ No newline at end of file diff --git a/pkg/tools/gen/testdata/jsonschema/complex-workflow/expect.k b/pkg/tools/gen/testdata/jsonschema/complex-workflow/expect.k new file mode 100644 index 00000000..170f5607 --- /dev/null +++ b/pkg/tools/gen/testdata/jsonschema/complex-workflow/expect.k @@ -0,0 +1,1747 @@ +""" +This file was generated by the KCL auto-gen tool. DO NOT EDIT. +Editing this file might prove futile when you re-run the KCL auto-gen generate command. +""" +import regex + +schema Workflow: + r""" + Workflow + + Attributes + ---------- + name : str, optional + The name of your workflow. GitHub displays the names of your workflows on your repository's actions page. If you omit this field, GitHub sets the name to the workflow's filename. + on : "branch_protection_rule" | "check_run" | "check_suite" | "create" | "delete" | "deployment" | "deployment_status" | "discussion" | "discussion_comment" | "fork" | "gollum" | "issue_comment" | "issues" | "label" | "member" | "milestone" | "page_build" | "project" | "project_card" | "project_column" | "public" | "pull_request" | "pull_request_review" | "pull_request_review_comment" | "pull_request_target" | "push" | "registry_package" | "release" | "status" | "watch" | "workflow_call" | "workflow_dispatch" | "workflow_run" | "repository_dispatch" | ["branch_protection_rule" | "check_run" | "check_suite" | "create" | "delete" | "deployment" | "deployment_status" | "discussion" | "discussion_comment" | "fork" | "gollum" | "issue_comment" | "issues" | "label" | "member" | "milestone" | "page_build" | "project" | "project_card" | "project_column" | "public" | "pull_request" | "pull_request_review" | "pull_request_review_comment" | "pull_request_target" | "push" | "registry_package" | "release" | "status" | "watch" | "workflow_call" | "workflow_dispatch" | "workflow_run" | "repository_dispatch"] | WorkflowOnOneOf2, required + The name of the GitHub event that triggers the workflow. You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow to specific files, tags, or branch changes. For a list of available events, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows. + env : WorkflowEnvOneOf0 | str, optional + A map of environment variables that are available to all jobs and steps in the workflow. + defaults : WorkflowDefaults, optional + A map of default settings that will apply to all jobs in the workflow. + concurrency : str | WorkflowConcurrencyOneOf1, optional + Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. + You can also specify concurrency at the workflow level. + When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true. + jobs : WorkflowJobs, required + A workflow run is made up of one or more jobs. Jobs run in parallel by default. To run jobs sequentially, you can define dependencies on other jobs using the jobs..needs keyword. + Each job runs in a fresh instance of the virtual environment specified by runs-on. + You can run an unlimited number of jobs as long as you are within the workflow usage limits. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#usage-limits. + permissions : "read-all" | "write-all" | WorkflowPermissionsOneOf1, optional + You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access. + """ + + name?: str + on: "branch_protection_rule" | "check_run" | "check_suite" | "create" | "delete" | "deployment" | "deployment_status" | "discussion" | "discussion_comment" | "fork" | "gollum" | "issue_comment" | "issues" | "label" | "member" | "milestone" | "page_build" | "project" | "project_card" | "project_column" | "public" | "pull_request" | "pull_request_review" | "pull_request_review_comment" | "pull_request_target" | "push" | "registry_package" | "release" | "status" | "watch" | "workflow_call" | "workflow_dispatch" | "workflow_run" | "repository_dispatch" | ["branch_protection_rule" | "check_run" | "check_suite" | "create" | "delete" | "deployment" | "deployment_status" | "discussion" | "discussion_comment" | "fork" | "gollum" | "issue_comment" | "issues" | "label" | "member" | "milestone" | "page_build" | "project" | "project_card" | "project_column" | "public" | "pull_request" | "pull_request_review" | "pull_request_review_comment" | "pull_request_target" | "push" | "registry_package" | "release" | "status" | "watch" | "workflow_call" | "workflow_dispatch" | "workflow_run" | "repository_dispatch"] | WorkflowOnOneOf2 + env?: WorkflowEnvOneOf0 | str + defaults?: WorkflowDefaults + concurrency?: str | WorkflowConcurrencyOneOf1 + jobs: WorkflowJobs + permissions?: "read-all" | "write-all" | WorkflowPermissionsOneOf1 + +schema WorkflowConcurrencyOneOf1: + r""" + WorkflowConcurrencyOneOf1 + + Attributes + ---------- + group : str, required + When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. + cancel_in_progress : bool | str, optional + To cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true. + """ + + group: str + cancel_in_progress?: bool | str + +schema WorkflowDefaults: + r""" + A map of default settings that will apply to all jobs in the workflow. + + Attributes + ---------- + run : WorkflowDefaultsRun, optional + """ + + run?: WorkflowDefaultsRun + +schema WorkflowDefaultsRun: + r""" + WorkflowDefaultsRun + + Attributes + ---------- + shell : any, optional + You can override the default shell settings in the runner's operating system using the shell keyword. You can use built-in shell keywords, or you can define a custom set of shell options. + working_directory : str, optional + Using the working-directory keyword, you can specify the working directory of where to run the command. + """ + + shell?: any + working_directory?: str + +schema WorkflowEnvOneOf0: + r""" + WorkflowEnvOneOf0 + """ + + [...str]: str | float | bool + +schema WorkflowJobs: + r""" + A workflow run is made up of one or more jobs. Jobs run in parallel by default. To run jobs sequentially, you can define dependencies on other jobs using the jobs..needs keyword. + Each job runs in a fresh instance of the virtual environment specified by runs-on. + You can run an unlimited number of jobs as long as you are within the workflow usage limits. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#usage-limits. + """ + + [key: str]: WorkflowJobsPatternProperties0OneOf0 | WorkflowJobsPatternProperties0OneOf1 + + check: + regex.match(key, r"^[_a-zA-Z][a-zA-Z0-9_-]*$") + +schema WorkflowJobsPatternProperties0OneOf0: + r""" + Each job must have an id to associate with the job. The key job_id is a string and its value is a map of the job's configuration data. You must replace with a string that is unique to the jobs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _. + + Attributes + ---------- + name : str, optional + The name of the job displayed on GitHub. + needs : [str] | str, optional + Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue. + permissions : "read-all" | "write-all" | WorkflowJobsPatternProperties0OneOf0PermissionsOneOf1, optional + You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access. + runs_on : "macos-10.15" | "macos-11" | "macos-12" | "macos-latest" | "self-hosted" | "ubuntu-18.04" | "ubuntu-20.04" | "ubuntu-22.04" | "ubuntu-latest" | "windows-2016" | "windows-2019" | "windows-2022" | "windows-latest" | any | str, required + The type of machine to run the job on. The machine can be either a GitHub-hosted runner, or a self-hosted runner. + environment : str | WorkflowJobsPatternProperties0OneOf0EnvironmentOneOf1, optional + The environment that the job references. + outputs : WorkflowJobsPatternProperties0OneOf0Outputs, optional + A map of outputs for a job. Job outputs are available to all downstream jobs that depend on this job. + env : WorkflowJobsPatternProperties0OneOf0EnvOneOf0 | str, optional + A map of environment variables that are available to all steps in the job. + defaults : WorkflowJobsPatternProperties0OneOf0Defaults, optional + A map of default settings that will apply to all steps in the job. + $if : str, optional + You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional. + Expressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions. + steps : [WorkflowJobsPatternProperties0OneOf0StepsItems0], optional + A job contains a sequence of tasks called steps. Steps can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry. Not all steps run actions, but all actions run as a step. Each step runs in its own process in the virtual environment and has access to the workspace and filesystem. Because steps run in their own process, changes to environment variables are not preserved between steps. GitHub provides built-in steps to set up and complete a job. + + timeout_minutes : float, optional, default is 360 + The maximum number of minutes to let a workflow run before GitHub automatically cancels it. Default: 360 + strategy : WorkflowJobsPatternProperties0OneOf0Strategy, optional + A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in. + continue_on_error : bool | str, optional + Prevents a workflow run from failing when a job fails. Set to true to allow a workflow run to pass when this job fails. + container : str | WorkflowJobsPatternProperties0OneOf0ContainerOneOf1, optional + A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts. + If you do not set a container, all steps will run directly on the host specified by runs-on unless a step refers to an action configured to run in a container. + services : WorkflowJobsPatternProperties0OneOf0Services, optional + Additional containers to host services for a job in a workflow. These are useful for creating databases or cache services like redis. The runner on the virtual machine will automatically create a network and manage the life cycle of the service containers. + When you use a service container for a job or your step uses container actions, you don't need to set port information to access the service. Docker automatically exposes all ports between containers on the same network. + When both the job and the action run in a container, you can directly reference the container by its hostname. The hostname is automatically mapped to the service name. + When a step does not use a container action, you must access the service using localhost and bind the ports. + concurrency : str | WorkflowJobsPatternProperties0OneOf0ConcurrencyOneOf1, optional + Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. + You can also specify concurrency at the workflow level. + When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true. + """ + + name?: str + needs?: [str] | str + permissions?: "read-all" | "write-all" | WorkflowJobsPatternProperties0OneOf0PermissionsOneOf1 + runs_on: "macos-10.15" | "macos-11" | "macos-12" | "macos-latest" | "self-hosted" | "ubuntu-18.04" | "ubuntu-20.04" | "ubuntu-22.04" | "ubuntu-latest" | "windows-2016" | "windows-2019" | "windows-2022" | "windows-latest" | any | str + environment?: str | WorkflowJobsPatternProperties0OneOf0EnvironmentOneOf1 + outputs?: WorkflowJobsPatternProperties0OneOf0Outputs + env?: WorkflowJobsPatternProperties0OneOf0EnvOneOf0 | str + defaults?: WorkflowJobsPatternProperties0OneOf0Defaults + $if?: str + steps?: [WorkflowJobsPatternProperties0OneOf0StepsItems0] + timeout_minutes?: float = 360 + strategy?: WorkflowJobsPatternProperties0OneOf0Strategy + continue_on_error?: bool | str + container?: str | WorkflowJobsPatternProperties0OneOf0ContainerOneOf1 + services?: WorkflowJobsPatternProperties0OneOf0Services + concurrency?: str | WorkflowJobsPatternProperties0OneOf0ConcurrencyOneOf1 + + check: + len(steps) >= 1 + +schema WorkflowJobsPatternProperties0OneOf0ConcurrencyOneOf1: + r""" + WorkflowJobsPatternProperties0OneOf0ConcurrencyOneOf1 + + Attributes + ---------- + group : str, required + When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. + cancel_in_progress : bool | str, optional + To cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true. + """ + + group: str + cancel_in_progress?: bool | str + +schema WorkflowJobsPatternProperties0OneOf0ContainerOneOf1: + r""" + WorkflowJobsPatternProperties0OneOf0ContainerOneOf1 + + Attributes + ---------- + image : str, required + The Docker image to use as the container to run the action. The value can be the Docker Hub image name or a registry name. + credentials : WorkflowJobsPatternProperties0OneOf0ContainerOneOf1Credentials, optional + If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command. + env : WorkflowJobsPatternProperties0OneOf0ContainerOneOf1EnvOneOf0 | str, optional + Sets an array of environment variables in the container. + ports : [float | str], optional + Sets an array of ports to expose on the container. + volumes : [str], optional + Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host. + To specify a volume, you specify the source and destination path: : + The is a volume name or an absolute path on the host machine, and is an absolute path in the container. + options : str, optional + Additional Docker container resource options. For a list of options, see https://docs.docker.com/engine/reference/commandline/create/#options. + """ + + image: str + credentials?: WorkflowJobsPatternProperties0OneOf0ContainerOneOf1Credentials + env?: WorkflowJobsPatternProperties0OneOf0ContainerOneOf1EnvOneOf0 | str + ports?: [float | str] + volumes?: [str] + options?: str + + check: + len(ports) >= 1 + len(volumes) >= 1 + +schema WorkflowJobsPatternProperties0OneOf0ContainerOneOf1Credentials: + r""" + If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command. + + Attributes + ---------- + username : str, optional + password : str, optional + """ + + username?: str + password?: str + +schema WorkflowJobsPatternProperties0OneOf0ContainerOneOf1EnvOneOf0: + r""" + WorkflowJobsPatternProperties0OneOf0ContainerOneOf1EnvOneOf0 + """ + + [...str]: str | float | bool + +schema WorkflowJobsPatternProperties0OneOf0Defaults: + r""" + A map of default settings that will apply to all steps in the job. + + Attributes + ---------- + run : WorkflowJobsPatternProperties0OneOf0DefaultsRun, optional + """ + + run?: WorkflowJobsPatternProperties0OneOf0DefaultsRun + +schema WorkflowJobsPatternProperties0OneOf0DefaultsRun: + r""" + WorkflowJobsPatternProperties0OneOf0DefaultsRun + + Attributes + ---------- + shell : any, optional + You can override the default shell settings in the runner's operating system using the shell keyword. You can use built-in shell keywords, or you can define a custom set of shell options. + working_directory : str, optional + Using the working-directory keyword, you can specify the working directory of where to run the command. + """ + + shell?: any + working_directory?: str + +schema WorkflowJobsPatternProperties0OneOf0EnvOneOf0: + r""" + WorkflowJobsPatternProperties0OneOf0EnvOneOf0 + """ + + [...str]: str | float | bool + +schema WorkflowJobsPatternProperties0OneOf0EnvironmentOneOf1: + r""" + The environment that the job references + + Attributes + ---------- + name : str, required + The name of the environment configured in the repo. + url : str, optional + A deployment URL + """ + + name: str + url?: str + +schema WorkflowJobsPatternProperties0OneOf0Outputs: + r""" + A map of outputs for a job. Job outputs are available to all downstream jobs that depend on this job. + """ + + [...str]: str + +schema WorkflowJobsPatternProperties0OneOf0PermissionsOneOf1: + r""" + WorkflowJobsPatternProperties0OneOf0PermissionsOneOf1 + + Attributes + ---------- + actions : "read" | "write" | "none", optional + checks : "read" | "write" | "none", optional + contents : "read" | "write" | "none", optional + deployments : "read" | "write" | "none", optional + discussions : "read" | "write" | "none", optional + id_token : "read" | "write" | "none", optional + issues : "read" | "write" | "none", optional + packages : "read" | "write" | "none", optional + pages : "read" | "write" | "none", optional + pull_requests : "read" | "write" | "none", optional + repository_projects : "read" | "write" | "none", optional + security_events : "read" | "write" | "none", optional + statuses : "read" | "write" | "none", optional + """ + + actions?: "read" | "write" | "none" + checks?: "read" | "write" | "none" + contents?: "read" | "write" | "none" + deployments?: "read" | "write" | "none" + discussions?: "read" | "write" | "none" + id_token?: "read" | "write" | "none" + issues?: "read" | "write" | "none" + packages?: "read" | "write" | "none" + pages?: "read" | "write" | "none" + pull_requests?: "read" | "write" | "none" + repository_projects?: "read" | "write" | "none" + security_events?: "read" | "write" | "none" + statuses?: "read" | "write" | "none" + +schema WorkflowJobsPatternProperties0OneOf0Services: + r""" + Additional containers to host services for a job in a workflow. These are useful for creating databases or cache services like redis. The runner on the virtual machine will automatically create a network and manage the life cycle of the service containers. + When you use a service container for a job or your step uses container actions, you don't need to set port information to access the service. Docker automatically exposes all ports between containers on the same network. + When both the job and the action run in a container, you can directly reference the container by its hostname. The hostname is automatically mapped to the service name. + When a step does not use a container action, you must access the service using localhost and bind the ports. + """ + + [...str]: WorkflowJobsPatternProperties0OneOf0ServicesAdditionalProperties + +schema WorkflowJobsPatternProperties0OneOf0ServicesAdditionalProperties: + r""" + WorkflowJobsPatternProperties0OneOf0ServicesAdditionalProperties + + Attributes + ---------- + image : str, required + The Docker image to use as the container to run the action. The value can be the Docker Hub image name or a registry name. + credentials : WorkflowJobsPatternProperties0OneOf0ServicesAdditionalPropertiesCredentials, optional + If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command. + env : WorkflowJobsPatternProperties0OneOf0ServicesAdditionalPropertiesEnvOneOf0 | str, optional + Sets an array of environment variables in the container. + ports : [float | str], optional + Sets an array of ports to expose on the container. + volumes : [str], optional + Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host. + To specify a volume, you specify the source and destination path: : + The is a volume name or an absolute path on the host machine, and is an absolute path in the container. + options : str, optional + Additional Docker container resource options. For a list of options, see https://docs.docker.com/engine/reference/commandline/create/#options. + """ + + image: str + credentials?: WorkflowJobsPatternProperties0OneOf0ServicesAdditionalPropertiesCredentials + env?: WorkflowJobsPatternProperties0OneOf0ServicesAdditionalPropertiesEnvOneOf0 | str + ports?: [float | str] + volumes?: [str] + options?: str + + check: + len(ports) >= 1 + len(volumes) >= 1 + +schema WorkflowJobsPatternProperties0OneOf0ServicesAdditionalPropertiesCredentials: + r""" + If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command. + + Attributes + ---------- + username : str, optional + password : str, optional + """ + + username?: str + password?: str + +schema WorkflowJobsPatternProperties0OneOf0ServicesAdditionalPropertiesEnvOneOf0: + r""" + WorkflowJobsPatternProperties0OneOf0ServicesAdditionalPropertiesEnvOneOf0 + """ + + [...str]: str | float | bool + +schema WorkflowJobsPatternProperties0OneOf0StepsItems0: + r""" + WorkflowJobsPatternProperties0OneOf0StepsItems0 + + Attributes + ---------- + id : str, optional + A unique identifier for the step. You can use the id to reference the step in contexts. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions. + $if : str, optional + You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional. + Expressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions. + name : str, optional + A name for your step to display on GitHub. + uses : str, optional + Selects an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image (https://hub.docker.com/). + We strongly recommend that you include the version of the action you are using by specifying a Git ref, SHA, or Docker tag number. If you don't specify a version, it could break your workflows or cause unexpected behavior when the action owner publishes an update. + - Using the commit SHA of a released action version is the safest for stability and security. + - Using the specific major action version allows you to receive critical fixes and security patches while still maintaining compatibility. It also assures that your workflow should still work. + - Using the master branch of an action may be convenient, but if someone releases a new major version with a breaking change, your workflow could break. + Some actions require inputs that you must set using the with keyword. Review the action's README file to determine the inputs required. + Actions are either JavaScript files or Docker containers. If the action you're using is a Docker container you must run the job in a Linux virtual environment. For more details, see https://help.github.com/en/articles/virtual-environments-for-github-actions. + run : str, optional + Runs command-line programs using the operating system's shell. If you do not provide a name, the step name will default to the text specified in the run command. + Commands run using non-login shells by default. You can choose a different shell and customize the shell used to run commands. For more information, see https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell. + Each run keyword represents a new process and shell in the virtual environment. When you provide multi-line commands, each line runs in the same shell. + working_directory : str, optional + Using the working-directory keyword, you can specify the working directory of where to run the command. + shell : any, optional + You can override the default shell settings in the runner's operating system using the shell keyword. You can use built-in shell keywords, or you can define a custom set of shell options. + with : WorkflowJobsPatternProperties0OneOf0StepsItems0WithOneOf0 | str | WorkflowJobsPatternProperties0OneOf0StepsItems0With, optional + A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case. + env : WorkflowJobsPatternProperties0OneOf0StepsItems0EnvOneOf0 | str, optional + Sets environment variables for steps to use in the virtual environment. You can also set environment variables for the entire workflow or a job. + continue_on_error : bool | str, optional, default is False + Prevents a job from failing when a step fails. Set to true to allow a job to pass when this step fails. + timeout_minutes : float, optional + The maximum number of minutes to run the step before killing the process. + """ + + id?: str + $if?: str + name?: str + uses?: str + run?: str + working_directory?: str + shell?: any + with?: WorkflowJobsPatternProperties0OneOf0StepsItems0WithOneOf0 | str | WorkflowJobsPatternProperties0OneOf0StepsItems0With + env?: WorkflowJobsPatternProperties0OneOf0StepsItems0EnvOneOf0 | str + continue_on_error?: bool | str = False + timeout_minutes?: float + +schema WorkflowJobsPatternProperties0OneOf0StepsItems0EnvOneOf0: + r""" + WorkflowJobsPatternProperties0OneOf0StepsItems0EnvOneOf0 + """ + + [...str]: str | float | bool + +schema WorkflowJobsPatternProperties0OneOf0StepsItems0With: + r""" + A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case. + + Attributes + ---------- + args : str, optional + entrypoint : str, optional + """ + + args?: str + entrypoint?: str + +schema WorkflowJobsPatternProperties0OneOf0StepsItems0WithOneOf0: + r""" + WorkflowJobsPatternProperties0OneOf0StepsItems0WithOneOf0 + """ + + [...str]: str | float | bool + +schema WorkflowJobsPatternProperties0OneOf0Strategy: + r""" + A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in. + + Attributes + ---------- + matrix : WorkflowJobsPatternProperties0OneOf0StrategyMatrixOneOf0 | str | WorkflowJobsPatternProperties0OneOf0StrategyMatrix, required + A build matrix is a set of different configurations of the virtual environment. For example you might run a job against more than one supported version of a language, operating system, or tool. Each configuration is a copy of the job that runs and reports a status. + You can specify a matrix by supplying an array for the configuration options. For example, if the GitHub virtual environment supports Node.js versions 6, 8, and 10 you could specify an array of those versions in the matrix. + When you define a matrix of operating systems, you must set the required runs-on keyword to the operating system of the current job, rather than hard-coding the operating system name. To access the operating system name, you can use the matrix.os context parameter to set runs-on. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions. + fail_fast : bool, optional, default is True + When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true + max_parallel : float, optional + The maximum number of jobs that can run simultaneously when using a matrix job strategy. By default, GitHub will maximize the number of jobs run in parallel depending on the available runners on GitHub-hosted virtual machines. + """ + + matrix: WorkflowJobsPatternProperties0OneOf0StrategyMatrixOneOf0 | str | WorkflowJobsPatternProperties0OneOf0StrategyMatrix + fail_fast?: bool = True + max_parallel?: float + +schema WorkflowJobsPatternProperties0OneOf0StrategyMatrix: + r""" + A build matrix is a set of different configurations of the virtual environment. For example you might run a job against more than one supported version of a language, operating system, or tool. Each configuration is a copy of the job that runs and reports a status. + You can specify a matrix by supplying an array for the configuration options. For example, if the GitHub virtual environment supports Node.js versions 6, 8, and 10 you could specify an array of those versions in the matrix. + When you define a matrix of operating systems, you must set the required runs-on keyword to the operating system of the current job, rather than hard-coding the operating system name. To access the operating system name, you can use the matrix.os context parameter to set runs-on. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions. + """ + + [...str]: [str | float | bool | WorkflowJobsPatternProperties0OneOf0StrategyMatrixAdditionalPropertiesOneOf0Items0OneOf3 | [any]] | str + +schema WorkflowJobsPatternProperties0OneOf0StrategyMatrixAdditionalPropertiesOneOf0Items0OneOf3: + r""" + WorkflowJobsPatternProperties0OneOf0StrategyMatrixAdditionalPropertiesOneOf0Items0OneOf3 + """ + + [...str]: any + +schema WorkflowJobsPatternProperties0OneOf0StrategyMatrixOneOf0: + r""" + WorkflowJobsPatternProperties0OneOf0StrategyMatrixOneOf0 + """ + + [...str]: any + +schema WorkflowJobsPatternProperties0OneOf0StrategyMatrixPatternProperties0Items0: + r""" + WorkflowJobsPatternProperties0OneOf0StrategyMatrixPatternProperties0Items0 + """ + + [...str]: str | float | bool | WorkflowJobsPatternProperties0OneOf0StrategyMatrixPatternProperties0Items0AdditionalPropertiesOneOf3 | [any] + +schema WorkflowJobsPatternProperties0OneOf0StrategyMatrixPatternProperties0Items0AdditionalPropertiesOneOf3: + r""" + WorkflowJobsPatternProperties0OneOf0StrategyMatrixPatternProperties0Items0AdditionalPropertiesOneOf3 + """ + + [...str]: str | float | bool | any | [str | float | bool | any | any] + +schema WorkflowJobsPatternProperties0OneOf1: + r""" + Each job must have an id to associate with the job. The key job_id is a string and its value is a map of the job's configuration data. You must replace with a string that is unique to the jobs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _. + + Attributes + ---------- + name : str, optional + The name of the job displayed on GitHub. + needs : [str] | str, optional + Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue. + permissions : WorkflowJobsPatternProperties0OneOf1Permissions, optional + $if : str, optional + You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional. + Expressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions. + uses : str, required + The location and version of a reusable workflow file to run as a job, of the form './{path/to}/{localfile}.yml' or '{owner}/{repo}/{path}/{filename}@{ref}'. {ref} can be a SHA, a release tag, or a branch name. Using the commit SHA is the safest for stability and security. + with : WorkflowJobsPatternProperties0OneOf1WithOneOf0 | str, optional + A map of inputs that are passed to the called workflow. Any inputs that you pass must match the input specifications defined in the called workflow. Unlike 'jobs..steps[*].with', the inputs you pass with 'jobs..with' are not be available as environment variables in the called workflow. Instead, you can reference the inputs by using the inputs context. + secrets : WorkflowJobsPatternProperties0OneOf1SecretsOneOf0OneOf0 | str | "inherit", optional + When a job is used to call a reusable workflow, you can use 'secrets' to provide a map of secrets that are passed to the called workflow. Any secrets that you pass must match the names defined in the called workflow. + concurrency : str | WorkflowJobsPatternProperties0OneOf1ConcurrencyOneOf1, optional + Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. + You can also specify concurrency at the workflow level. + When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true. + """ + + name?: str + needs?: [str] | str + permissions?: WorkflowJobsPatternProperties0OneOf1Permissions + $if?: str + uses: str + with?: WorkflowJobsPatternProperties0OneOf1WithOneOf0 | str + secrets?: WorkflowJobsPatternProperties0OneOf1SecretsOneOf0OneOf0 | str | "inherit" + concurrency?: str | WorkflowJobsPatternProperties0OneOf1ConcurrencyOneOf1 + + check: + regex.match(uses, r"^(.+/)+(.+)\.(ya?ml)(@.+)?$") + +schema WorkflowJobsPatternProperties0OneOf1ConcurrencyOneOf1: + r""" + WorkflowJobsPatternProperties0OneOf1ConcurrencyOneOf1 + + Attributes + ---------- + group : str, required + When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. + cancel_in_progress : bool | str, optional + To cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true. + """ + + group: str + cancel_in_progress?: bool | str + +schema WorkflowJobsPatternProperties0OneOf1Permissions: + r""" + WorkflowJobsPatternProperties0OneOf1Permissions + + Attributes + ---------- + actions : "read" | "write" | "none", optional + checks : "read" | "write" | "none", optional + contents : "read" | "write" | "none", optional + deployments : "read" | "write" | "none", optional + discussions : "read" | "write" | "none", optional + id_token : "read" | "write" | "none", optional + issues : "read" | "write" | "none", optional + packages : "read" | "write" | "none", optional + pages : "read" | "write" | "none", optional + pull_requests : "read" | "write" | "none", optional + repository_projects : "read" | "write" | "none", optional + security_events : "read" | "write" | "none", optional + statuses : "read" | "write" | "none", optional + """ + + actions?: "read" | "write" | "none" + checks?: "read" | "write" | "none" + contents?: "read" | "write" | "none" + deployments?: "read" | "write" | "none" + discussions?: "read" | "write" | "none" + id_token?: "read" | "write" | "none" + issues?: "read" | "write" | "none" + packages?: "read" | "write" | "none" + pages?: "read" | "write" | "none" + pull_requests?: "read" | "write" | "none" + repository_projects?: "read" | "write" | "none" + security_events?: "read" | "write" | "none" + statuses?: "read" | "write" | "none" + +schema WorkflowJobsPatternProperties0OneOf1SecretsOneOf0OneOf0: + r""" + WorkflowJobsPatternProperties0OneOf1SecretsOneOf0OneOf0 + """ + + [...str]: str | float | bool + +schema WorkflowJobsPatternProperties0OneOf1WithOneOf0: + r""" + WorkflowJobsPatternProperties0OneOf1WithOneOf0 + """ + + [...str]: str | float | bool + +schema WorkflowOnOneOf2: + r""" + WorkflowOnOneOf2 + + Attributes + ---------- + branch_protection_rule : WorkflowOnOneOf2BranchProtectionRuleOneOf0 | str | WorkflowOnOneOf2BranchProtectionRule, optional + Runs your workflow anytime the branch_protection_rule event occurs. More than one activity type triggers this event. + check_run : WorkflowOnOneOf2CheckRunOneOf0 | str | WorkflowOnOneOf2CheckRun, optional + Runs your workflow anytime the check_run event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/runs. + check_suite : WorkflowOnOneOf2CheckSuiteOneOf0 | str | WorkflowOnOneOf2CheckSuite, optional + Runs your workflow anytime the check_suite event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/suites/. + create : WorkflowOnOneOf2CreateOneOf0 | str, optional + Runs your workflow anytime someone creates a branch or tag, which triggers the create event. For information about the REST API, see https://developer.github.com/v3/git/refs/#create-a-reference. + delete : WorkflowOnOneOf2DeleteOneOf0 | str, optional + Runs your workflow anytime someone deletes a branch or tag, which triggers the delete event. For information about the REST API, see https://developer.github.com/v3/git/refs/#delete-a-reference. + deployment : WorkflowOnOneOf2DeploymentOneOf0 | str, optional + Runs your workflow anytime someone creates a deployment, which triggers the deployment event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/. + deployment_status : WorkflowOnOneOf2DeploymentStatusOneOf0 | str, optional + Runs your workflow anytime a third party provides a deployment status, which triggers the deployment_status event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/#create-a-deployment-status. + discussion : WorkflowOnOneOf2DiscussionOneOf0 | str | WorkflowOnOneOf2Discussion, optional + Runs your workflow anytime the discussion event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions + discussion_comment : WorkflowOnOneOf2DiscussionCommentOneOf0 | str | WorkflowOnOneOf2DiscussionComment, optional + Runs your workflow anytime the discussion_comment event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions + fork : WorkflowOnOneOf2ForkOneOf0 | str, optional + Runs your workflow anytime when someone forks a repository, which triggers the fork event. For information about the REST API, see https://developer.github.com/v3/repos/forks/#create-a-fork. + gollum : WorkflowOnOneOf2GollumOneOf0 | str, optional + Runs your workflow when someone creates or updates a Wiki page, which triggers the gollum event. + issue_comment : WorkflowOnOneOf2IssueCommentOneOf0 | str | WorkflowOnOneOf2IssueComment, optional + Runs your workflow anytime the issue_comment event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/comments/. + issues : WorkflowOnOneOf2IssuesOneOf0 | str | WorkflowOnOneOf2Issues, optional + Runs your workflow anytime the issues event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues. + label : WorkflowOnOneOf2LabelOneOf0 | str | WorkflowOnOneOf2Label, optional + Runs your workflow anytime the label event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/labels/. + member : WorkflowOnOneOf2MemberOneOf0 | str | WorkflowOnOneOf2Member, optional + Runs your workflow anytime the member event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/collaborators/. + milestone : WorkflowOnOneOf2MilestoneOneOf0 | str | WorkflowOnOneOf2Milestone, optional + Runs your workflow anytime the milestone event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/milestones/. + page_build : WorkflowOnOneOf2PageBuildOneOf0 | str, optional + Runs your workflow anytime someone pushes to a GitHub Pages-enabled branch, which triggers the page_build event. For information about the REST API, see https://developer.github.com/v3/repos/pages/. + project : WorkflowOnOneOf2ProjectOneOf0 | str | WorkflowOnOneOf2Project, optional + Runs your workflow anytime the project event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/. + project_card : WorkflowOnOneOf2ProjectCardOneOf0 | str | WorkflowOnOneOf2ProjectCard, optional + Runs your workflow anytime the project_card event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/cards. + project_column : WorkflowOnOneOf2ProjectColumnOneOf0 | str | WorkflowOnOneOf2ProjectColumn, optional + Runs your workflow anytime the project_column event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/columns. + public : WorkflowOnOneOf2PublicOneOf0 | str, optional + Runs your workflow anytime someone makes a private repository public, which triggers the public event. For information about the REST API, see https://developer.github.com/v3/repos/#edit. + pull_request : WorkflowOnOneOf2PullRequestOneOf0 | str | WorkflowOnOneOf2PullRequest, optional + Runs your workflow anytime the pull_request event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls. + Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. + When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository. + Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository. + The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions. + pull_request_review : WorkflowOnOneOf2PullRequestReviewOneOf0 | str | WorkflowOnOneOf2PullRequestReview, optional + Runs your workflow anytime the pull_request_review event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/reviews. + Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. + When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository. + Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository. + The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions. + pull_request_review_comment : WorkflowOnOneOf2PullRequestReviewCommentOneOf0 | str | WorkflowOnOneOf2PullRequestReviewComment, optional + Runs your workflow anytime a comment on a pull request's unified diff is modified, which triggers the pull_request_review_comment event. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/comments. + Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. + When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository. + Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository. + The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions. + pull_request_target : WorkflowOnOneOf2PullRequestTargetOneOf0 | str | WorkflowOnOneOf2PullRequestTarget, optional + This event is similar to pull_request, except that it runs in the context of the base repository of the pull request, rather than in the merge commit. This means that you can more safely make your secrets available to the workflows triggered by the pull request, because only workflows defined in the commit on the base repository are run. For example, this event allows you to create workflows that label and comment on pull requests, based on the contents of the event payload. + push : WorkflowOnOneOf2PushOneOf0 | str | WorkflowOnOneOf2Push, optional + Runs your workflow when someone pushes to a repository branch, which triggers the push event. + Note: The webhook payload available to GitHub Actions does not include the added, removed, and modified attributes in the commit object. You can retrieve the full commit object using the REST API. For more information, see https://developer.github.com/v3/repos/commits/#get-a-single-commit. + registry_package : WorkflowOnOneOf2RegistryPackageOneOf0 | str | WorkflowOnOneOf2RegistryPackage, optional + Runs your workflow anytime a package is published or updated. For more information, see https://help.github.com/en/github/managing-packages-with-github-packages. + release : WorkflowOnOneOf2ReleaseOneOf0 | str | WorkflowOnOneOf2Release, optional + Runs your workflow anytime the release event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/releases/ in the GitHub Developer documentation. + status : WorkflowOnOneOf2StatusOneOf0 | str, optional + Runs your workflow anytime the status of a Git commit changes, which triggers the status event. For information about the REST API, see https://developer.github.com/v3/repos/statuses/. + watch : WorkflowOnOneOf2WatchOneOf0 | str, optional + Runs your workflow anytime the watch event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/activity/starring/. + workflow_call : WorkflowOnOneOf2WorkflowCall, optional + Allows workflows to be reused by other workflows. + workflow_dispatch : WorkflowOnOneOf2WorkflowDispatch, optional + You can now create workflows that are manually triggered with the new workflow_dispatch event. You will then see a 'Run workflow' button on the Actions tab, enabling you to easily trigger a run. + workflow_run : WorkflowOnOneOf2WorkflowRunOneOf0 | str | WorkflowOnOneOf2WorkflowRun, optional + This event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow. For example, if your pull_request workflow generates build artifacts, you can create a new workflow that uses workflow_run to analyze the results and add a comment to the original pull request. + repository_dispatch : WorkflowOnOneOf2RepositoryDispatchOneOf0 | str, optional + You can use the GitHub API to trigger a webhook event called repository_dispatch when you want to trigger a workflow for activity that happens outside of GitHub. For more information, see https://developer.github.com/v3/repos/#create-a-repository-dispatch-event. + To trigger the custom repository_dispatch webhook event, you must send a POST request to a GitHub API endpoint and provide an event_type name to describe the activity type. To trigger a workflow run, you must also configure your workflow to use the repository_dispatch event. + schedule : [WorkflowOnOneOf2ScheduleItems0], optional + You can schedule a workflow to run at specific UTC times using POSIX cron syntax (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07). Scheduled workflows run on the latest commit on the default or base branch. The shortest interval you can run scheduled workflows is once every 5 minutes. + Note: GitHub Actions does not support the non-standard syntax @yearly, @monthly, @weekly, @daily, @hourly, and @reboot. + You can use crontab guru (https://crontab.guru/). to help generate your cron syntax and confirm what time it will run. To help you get started, there is also a list of crontab guru examples (https://crontab.guru/examples.html). + """ + + branch_protection_rule?: WorkflowOnOneOf2BranchProtectionRuleOneOf0 | str | WorkflowOnOneOf2BranchProtectionRule + check_run?: WorkflowOnOneOf2CheckRunOneOf0 | str | WorkflowOnOneOf2CheckRun + check_suite?: WorkflowOnOneOf2CheckSuiteOneOf0 | str | WorkflowOnOneOf2CheckSuite + create?: WorkflowOnOneOf2CreateOneOf0 | str + delete?: WorkflowOnOneOf2DeleteOneOf0 | str + deployment?: WorkflowOnOneOf2DeploymentOneOf0 | str + deployment_status?: WorkflowOnOneOf2DeploymentStatusOneOf0 | str + discussion?: WorkflowOnOneOf2DiscussionOneOf0 | str | WorkflowOnOneOf2Discussion + discussion_comment?: WorkflowOnOneOf2DiscussionCommentOneOf0 | str | WorkflowOnOneOf2DiscussionComment + fork?: WorkflowOnOneOf2ForkOneOf0 | str + gollum?: WorkflowOnOneOf2GollumOneOf0 | str + issue_comment?: WorkflowOnOneOf2IssueCommentOneOf0 | str | WorkflowOnOneOf2IssueComment + issues?: WorkflowOnOneOf2IssuesOneOf0 | str | WorkflowOnOneOf2Issues + label?: WorkflowOnOneOf2LabelOneOf0 | str | WorkflowOnOneOf2Label + member?: WorkflowOnOneOf2MemberOneOf0 | str | WorkflowOnOneOf2Member + milestone?: WorkflowOnOneOf2MilestoneOneOf0 | str | WorkflowOnOneOf2Milestone + page_build?: WorkflowOnOneOf2PageBuildOneOf0 | str + project?: WorkflowOnOneOf2ProjectOneOf0 | str | WorkflowOnOneOf2Project + project_card?: WorkflowOnOneOf2ProjectCardOneOf0 | str | WorkflowOnOneOf2ProjectCard + project_column?: WorkflowOnOneOf2ProjectColumnOneOf0 | str | WorkflowOnOneOf2ProjectColumn + public?: WorkflowOnOneOf2PublicOneOf0 | str + pull_request?: WorkflowOnOneOf2PullRequestOneOf0 | str | WorkflowOnOneOf2PullRequest + pull_request_review?: WorkflowOnOneOf2PullRequestReviewOneOf0 | str | WorkflowOnOneOf2PullRequestReview + pull_request_review_comment?: WorkflowOnOneOf2PullRequestReviewCommentOneOf0 | str | WorkflowOnOneOf2PullRequestReviewComment + pull_request_target?: WorkflowOnOneOf2PullRequestTargetOneOf0 | str | WorkflowOnOneOf2PullRequestTarget + push?: WorkflowOnOneOf2PushOneOf0 | str | WorkflowOnOneOf2Push + registry_package?: WorkflowOnOneOf2RegistryPackageOneOf0 | str | WorkflowOnOneOf2RegistryPackage + release?: WorkflowOnOneOf2ReleaseOneOf0 | str | WorkflowOnOneOf2Release + status?: WorkflowOnOneOf2StatusOneOf0 | str + watch?: WorkflowOnOneOf2WatchOneOf0 | str + workflow_call?: WorkflowOnOneOf2WorkflowCall + workflow_dispatch?: WorkflowOnOneOf2WorkflowDispatch + workflow_run?: WorkflowOnOneOf2WorkflowRunOneOf0 | str | WorkflowOnOneOf2WorkflowRun + repository_dispatch?: WorkflowOnOneOf2RepositoryDispatchOneOf0 | str + schedule?: [WorkflowOnOneOf2ScheduleItems0] + + check: + len(schedule) >= 1 + +schema WorkflowOnOneOf2BranchProtectionRule: + r""" + Runs your workflow anytime the branch_protection_rule event occurs. More than one activity type triggers this event. + + Attributes + ---------- + types : ["created" | "edited" | "deleted"], optional, default is ["created", "edited", "deleted"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "edited" | "deleted"] = ["created", "edited", "deleted"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2BranchProtectionRuleOneOf0: + r""" + WorkflowOnOneOf2BranchProtectionRuleOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2CheckRun: + r""" + Runs your workflow anytime the check_run event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/runs. + + Attributes + ---------- + types : ["created" | "rerequested" | "completed" | "requested_action"], optional, default is ["created", "rerequested", "completed", "requested_action"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "rerequested" | "completed" | "requested_action"] = ["created", "rerequested", "completed", "requested_action"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2CheckRunOneOf0: + r""" + WorkflowOnOneOf2CheckRunOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2CheckSuite: + r""" + Runs your workflow anytime the check_suite event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/suites/. + + Attributes + ---------- + types : ["completed" | "requested" | "rerequested"], optional, default is ["completed", "requested", "rerequested"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["completed" | "requested" | "rerequested"] = ["completed", "requested", "rerequested"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2CheckSuiteOneOf0: + r""" + WorkflowOnOneOf2CheckSuiteOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2CreateOneOf0: + r""" + WorkflowOnOneOf2CreateOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2DeleteOneOf0: + r""" + WorkflowOnOneOf2DeleteOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2DeploymentOneOf0: + r""" + WorkflowOnOneOf2DeploymentOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2DeploymentStatusOneOf0: + r""" + WorkflowOnOneOf2DeploymentStatusOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2Discussion: + r""" + Runs your workflow anytime the discussion event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions + + Attributes + ---------- + types : ["created" | "edited" | "deleted" | "transferred" | "pinned" | "unpinned" | "labeled" | "unlabeled" | "locked" | "unlocked" | "category_changed" | "answered" | "unanswered"], optional, default is ["created", "edited", "deleted", "transferred", "pinned", "unpinned", "labeled", "unlabeled", "locked", "unlocked", "category_changed", "answered", "unanswered"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "edited" | "deleted" | "transferred" | "pinned" | "unpinned" | "labeled" | "unlabeled" | "locked" | "unlocked" | "category_changed" | "answered" | "unanswered"] = ["created", "edited", "deleted", "transferred", "pinned", "unpinned", "labeled", "unlabeled", "locked", "unlocked", "category_changed", "answered", "unanswered"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2DiscussionComment: + r""" + Runs your workflow anytime the discussion_comment event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions + + Attributes + ---------- + types : ["created" | "edited" | "deleted"], optional, default is ["created", "edited", "deleted"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "edited" | "deleted"] = ["created", "edited", "deleted"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2DiscussionCommentOneOf0: + r""" + WorkflowOnOneOf2DiscussionCommentOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2DiscussionOneOf0: + r""" + WorkflowOnOneOf2DiscussionOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2ForkOneOf0: + r""" + WorkflowOnOneOf2ForkOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2GollumOneOf0: + r""" + WorkflowOnOneOf2GollumOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2IssueComment: + r""" + Runs your workflow anytime the issue_comment event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/comments/. + + Attributes + ---------- + types : ["created" | "edited" | "deleted"], optional, default is ["created", "edited", "deleted"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "edited" | "deleted"] = ["created", "edited", "deleted"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2IssueCommentOneOf0: + r""" + WorkflowOnOneOf2IssueCommentOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2Issues: + r""" + Runs your workflow anytime the issues event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues. + + Attributes + ---------- + types : ["opened" | "edited" | "deleted" | "transferred" | "pinned" | "unpinned" | "closed" | "reopened" | "assigned" | "unassigned" | "labeled" | "unlabeled" | "locked" | "unlocked" | "milestoned" | "demilestoned"], optional, default is ["opened", "edited", "deleted", "transferred", "pinned", "unpinned", "closed", "reopened", "assigned", "unassigned", "labeled", "unlabeled", "locked", "unlocked", "milestoned", "demilestoned"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["opened" | "edited" | "deleted" | "transferred" | "pinned" | "unpinned" | "closed" | "reopened" | "assigned" | "unassigned" | "labeled" | "unlabeled" | "locked" | "unlocked" | "milestoned" | "demilestoned"] = ["opened", "edited", "deleted", "transferred", "pinned", "unpinned", "closed", "reopened", "assigned", "unassigned", "labeled", "unlabeled", "locked", "unlocked", "milestoned", "demilestoned"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2IssuesOneOf0: + r""" + WorkflowOnOneOf2IssuesOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2Label: + r""" + Runs your workflow anytime the label event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/labels/. + + Attributes + ---------- + types : ["created" | "edited" | "deleted"], optional, default is ["created", "edited", "deleted"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "edited" | "deleted"] = ["created", "edited", "deleted"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2LabelOneOf0: + r""" + WorkflowOnOneOf2LabelOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2Member: + r""" + Runs your workflow anytime the member event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/collaborators/. + + Attributes + ---------- + types : ["added" | "edited" | "deleted"], optional, default is ["added", "edited", "deleted"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["added" | "edited" | "deleted"] = ["added", "edited", "deleted"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2MemberOneOf0: + r""" + WorkflowOnOneOf2MemberOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2Milestone: + r""" + Runs your workflow anytime the milestone event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/milestones/. + + Attributes + ---------- + types : ["created" | "closed" | "opened" | "edited" | "deleted"], optional, default is ["created", "closed", "opened", "edited", "deleted"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "closed" | "opened" | "edited" | "deleted"] = ["created", "closed", "opened", "edited", "deleted"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2MilestoneOneOf0: + r""" + WorkflowOnOneOf2MilestoneOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2PageBuildOneOf0: + r""" + WorkflowOnOneOf2PageBuildOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2Project: + r""" + Runs your workflow anytime the project event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/. + + Attributes + ---------- + types : ["created" | "updated" | "closed" | "reopened" | "edited" | "deleted"], optional, default is ["created", "updated", "closed", "reopened", "edited", "deleted"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "updated" | "closed" | "reopened" | "edited" | "deleted"] = ["created", "updated", "closed", "reopened", "edited", "deleted"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2ProjectCard: + r""" + Runs your workflow anytime the project_card event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/cards. + + Attributes + ---------- + types : ["created" | "moved" | "converted" | "edited" | "deleted"], optional, default is ["created", "moved", "converted", "edited", "deleted"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "moved" | "converted" | "edited" | "deleted"] = ["created", "moved", "converted", "edited", "deleted"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2ProjectCardOneOf0: + r""" + WorkflowOnOneOf2ProjectCardOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2ProjectColumn: + r""" + Runs your workflow anytime the project_column event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/columns. + + Attributes + ---------- + types : ["created" | "updated" | "moved" | "deleted"], optional, default is ["created", "updated", "moved", "deleted"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "updated" | "moved" | "deleted"] = ["created", "updated", "moved", "deleted"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2ProjectColumnOneOf0: + r""" + WorkflowOnOneOf2ProjectColumnOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2ProjectOneOf0: + r""" + WorkflowOnOneOf2ProjectOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2PublicOneOf0: + r""" + WorkflowOnOneOf2PublicOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2PullRequest: + r""" + Runs your workflow anytime the pull_request event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls. + Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. + When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository. + Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository. + The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions. + + Attributes + ---------- + types : ["assigned" | "unassigned" | "labeled" | "unlabeled" | "opened" | "edited" | "closed" | "reopened" | "synchronize" | "converted_to_draft" | "ready_for_review" | "locked" | "unlocked" | "review_requested" | "review_request_removed" | "auto_merge_enabled" | "auto_merge_disabled"], optional, default is ["opened", "synchronize", "reopened"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + branches : [str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + branches_ignore : [str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + tags : [str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + tags_ignore : [str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + paths : [str], optional + When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. Path filters are not evaluated for pushes to tags. + The paths-ignore and paths keywords accept glob patterns that use the * and ** wildcard characters to match more than one path name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + You can exclude paths using two types of filters. You cannot use both of these filters for the same event in a workflow. + - paths-ignore - Use the paths-ignore filter when you only need to exclude path names. + - paths - Use the paths filter when you need to filter paths for positive matches and exclude paths. + paths_ignore : [str], optional + When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. Path filters are not evaluated for pushes to tags. + The paths-ignore and paths keywords accept glob patterns that use the * and ** wildcard characters to match more than one path name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + You can exclude paths using two types of filters. You cannot use both of these filters for the same event in a workflow. + - paths-ignore - Use the paths-ignore filter when you only need to exclude path names. + - paths - Use the paths filter when you need to filter paths for positive matches and exclude paths. + """ + + types?: ["assigned" | "unassigned" | "labeled" | "unlabeled" | "opened" | "edited" | "closed" | "reopened" | "synchronize" | "converted_to_draft" | "ready_for_review" | "locked" | "unlocked" | "review_requested" | "review_request_removed" | "auto_merge_enabled" | "auto_merge_disabled"] = ["opened", "synchronize", "reopened"] + branches?: [str] + branches_ignore?: [str] + tags?: [str] + tags_ignore?: [str] + paths?: [str] + paths_ignore?: [str] + [key: str]: any + + check: + len(types) >= 1 + len(branches) >= 1 + len(branches_ignore) >= 1 + len(tags) >= 1 + len(tags_ignore) >= 1 + len(paths) >= 1 + len(paths_ignore) >= 1 + regex.match(key, r"^(branche|tag|path)s(-ignore)?$") + +schema WorkflowOnOneOf2PullRequestOneOf0: + r""" + WorkflowOnOneOf2PullRequestOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2PullRequestReview: + r""" + Runs your workflow anytime the pull_request_review event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/reviews. + Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. + When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository. + Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository. + The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions. + + Attributes + ---------- + types : ["submitted" | "edited" | "dismissed"], optional, default is ["submitted", "edited", "dismissed"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["submitted" | "edited" | "dismissed"] = ["submitted", "edited", "dismissed"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2PullRequestReviewComment: + r""" + Runs your workflow anytime a comment on a pull request's unified diff is modified, which triggers the pull_request_review_comment event. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/comments. + Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. + When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository. + Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository. + The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions. + + Attributes + ---------- + types : ["created" | "edited" | "deleted"], optional, default is ["created", "edited", "deleted"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["created" | "edited" | "deleted"] = ["created", "edited", "deleted"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2PullRequestReviewCommentOneOf0: + r""" + WorkflowOnOneOf2PullRequestReviewCommentOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2PullRequestReviewOneOf0: + r""" + WorkflowOnOneOf2PullRequestReviewOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2PullRequestTarget: + r""" + This event is similar to pull_request, except that it runs in the context of the base repository of the pull request, rather than in the merge commit. This means that you can more safely make your secrets available to the workflows triggered by the pull request, because only workflows defined in the commit on the base repository are run. For example, this event allows you to create workflows that label and comment on pull requests, based on the contents of the event payload. + + Attributes + ---------- + types : ["assigned" | "unassigned" | "labeled" | "unlabeled" | "opened" | "edited" | "closed" | "reopened" | "synchronize" | "converted_to_draft" | "ready_for_review" | "locked" | "unlocked" | "review_requested" | "review_request_removed" | "auto_merge_enabled" | "auto_merge_disabled"], optional, default is ["opened", "synchronize", "reopened"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + branches : [str | str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + branches_ignore : [str | str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + tags : [str | str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + tags_ignore : [str | str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + paths : [str | str], optional + When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. Path filters are not evaluated for pushes to tags. + The paths-ignore and paths keywords accept glob patterns that use the * and ** wildcard characters to match more than one path name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + You can exclude paths using two types of filters. You cannot use both of these filters for the same event in a workflow. + - paths-ignore - Use the paths-ignore filter when you only need to exclude path names. + - paths - Use the paths filter when you need to filter paths for positive matches and exclude paths. + paths_ignore : [str | str], optional + When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. Path filters are not evaluated for pushes to tags. + The paths-ignore and paths keywords accept glob patterns that use the * and ** wildcard characters to match more than one path name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + You can exclude paths using two types of filters. You cannot use both of these filters for the same event in a workflow. + - paths-ignore - Use the paths-ignore filter when you only need to exclude path names. + - paths - Use the paths filter when you need to filter paths for positive matches and exclude paths. + """ + + types?: ["assigned" | "unassigned" | "labeled" | "unlabeled" | "opened" | "edited" | "closed" | "reopened" | "synchronize" | "converted_to_draft" | "ready_for_review" | "locked" | "unlocked" | "review_requested" | "review_request_removed" | "auto_merge_enabled" | "auto_merge_disabled"] = ["opened", "synchronize", "reopened"] + branches?: [str | str] + branches_ignore?: [str | str] + tags?: [str | str] + tags_ignore?: [str | str] + paths?: [str | str] + paths_ignore?: [str | str] + [key: str]: any + + check: + len(types) >= 1 + len(branches) >= 1 + len(branches_ignore) >= 1 + len(tags) >= 1 + len(tags_ignore) >= 1 + len(paths) >= 1 + len(paths_ignore) >= 1 + regex.match(key, r"^(branche|tag|path)s(-ignore)?$") + +schema WorkflowOnOneOf2PullRequestTargetOneOf0: + r""" + WorkflowOnOneOf2PullRequestTargetOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2Push: + r""" + Runs your workflow when someone pushes to a repository branch, which triggers the push event. + Note: The webhook payload available to GitHub Actions does not include the added, removed, and modified attributes in the commit object. You can retrieve the full commit object using the REST API. For more information, see https://developer.github.com/v3/repos/commits/#get-a-single-commit. + + Attributes + ---------- + branches : [str | str | str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + branches_ignore : [str | str | str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + tags : [str | str | str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + tags_ignore : [str | str | str], optional + When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. + The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + The patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref. + You can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches: + - branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names. + - tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names. + You can exclude tags and branches using the ! character. The order that you define patterns matters. + - A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref. + - A matching positive pattern after a negative match will include the Git ref again. + paths : [str | str | str], optional + When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. Path filters are not evaluated for pushes to tags. + The paths-ignore and paths keywords accept glob patterns that use the * and ** wildcard characters to match more than one path name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + You can exclude paths using two types of filters. You cannot use both of these filters for the same event in a workflow. + - paths-ignore - Use the paths-ignore filter when you only need to exclude path names. + - paths - Use the paths filter when you need to filter paths for positive matches and exclude paths. + paths_ignore : [str | str | str], optional + When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. Path filters are not evaluated for pushes to tags. + The paths-ignore and paths keywords accept glob patterns that use the * and ** wildcard characters to match more than one path name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. + You can exclude paths using two types of filters. You cannot use both of these filters for the same event in a workflow. + - paths-ignore - Use the paths-ignore filter when you only need to exclude path names. + - paths - Use the paths filter when you need to filter paths for positive matches and exclude paths. + """ + + branches?: [str | str | str] + branches_ignore?: [str | str | str] + tags?: [str | str | str] + tags_ignore?: [str | str | str] + paths?: [str | str | str] + paths_ignore?: [str | str | str] + [key: str]: [str] + + check: + len(branches) >= 1 + len(branches_ignore) >= 1 + len(tags) >= 1 + len(tags_ignore) >= 1 + len(paths) >= 1 + len(paths_ignore) >= 1 + regex.match(key, r"^(branche|tag|path)s(-ignore)?$") + +schema WorkflowOnOneOf2PushOneOf0: + r""" + WorkflowOnOneOf2PushOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2RegistryPackage: + r""" + Runs your workflow anytime a package is published or updated. For more information, see https://help.github.com/en/github/managing-packages-with-github-packages. + + Attributes + ---------- + types : ["published" | "updated"], optional, default is ["published", "updated"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["published" | "updated"] = ["published", "updated"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2RegistryPackageOneOf0: + r""" + WorkflowOnOneOf2RegistryPackageOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2Release: + r""" + Runs your workflow anytime the release event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/releases/ in the GitHub Developer documentation. + + Attributes + ---------- + types : ["published" | "unpublished" | "created" | "edited" | "deleted" | "prereleased" | "released"], optional, default is ["published", "unpublished", "created", "edited", "deleted", "prereleased", "released"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + """ + + types?: ["published" | "unpublished" | "created" | "edited" | "deleted" | "prereleased" | "released"] = ["published", "unpublished", "created", "edited", "deleted", "prereleased", "released"] + [...str]: any + + check: + len(types) >= 1 + +schema WorkflowOnOneOf2ReleaseOneOf0: + r""" + WorkflowOnOneOf2ReleaseOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2RepositoryDispatchOneOf0: + r""" + WorkflowOnOneOf2RepositoryDispatchOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2ScheduleItems0: + r""" + WorkflowOnOneOf2ScheduleItems0 + + Attributes + ---------- + cron : str, optional + """ + + cron?: str + + check: + regex.match(cron, r"^(((\d+,)+\d+|((\d+|\*)/\d+|((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?))|(\d+-\d+)|\d+|\*|((MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?)) ?){5}$") + +schema WorkflowOnOneOf2StatusOneOf0: + r""" + WorkflowOnOneOf2StatusOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2WatchOneOf0: + r""" + WorkflowOnOneOf2WatchOneOf0 + """ + + [...str]: any + +schema WorkflowOnOneOf2WorkflowCall: + r""" + Allows workflows to be reused by other workflows. + + Attributes + ---------- + inputs : WorkflowOnOneOf2WorkflowCallInputs, optional + When using the workflow_call keyword, you can optionally specify inputs that are passed to the called workflow from the caller workflow. + secrets : WorkflowOnOneOf2WorkflowCallSecrets, optional + A map of the secrets that can be used in the called workflow. Within the called workflow, you can use the secrets context to refer to a secret. + """ + + inputs?: WorkflowOnOneOf2WorkflowCallInputs + secrets?: WorkflowOnOneOf2WorkflowCallSecrets + +schema WorkflowOnOneOf2WorkflowCallInputs: + r""" + When using the workflow_call keyword, you can optionally specify inputs that are passed to the called workflow from the caller workflow. + """ + + [key: str]: WorkflowOnOneOf2WorkflowCallInputsPatternProperties0 + + check: + regex.match(key, r"^[_a-zA-Z][a-zA-Z0-9_-]*$") + +schema WorkflowOnOneOf2WorkflowCallInputsPatternProperties0: + r""" + A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _. + + Attributes + ---------- + description : str, optional + A string description of the input parameter. + deprecation_message : str, optional + A string shown to users using the deprecated input. + required : bool, required + A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required. + type : "boolean" | "number" | "string", required + Required if input is defined for the on.workflow_call keyword. The value of this parameter is a string specifying the data type of the input. This must be one of: boolean, number, or string. + default : bool | float | str, optional + The default value is used when an input parameter isn't specified in a workflow file. + """ + + description?: str + deprecation_message?: str + required: bool + type: "boolean" | "number" | "string" + default?: bool | float | str + +schema WorkflowOnOneOf2WorkflowCallSecrets: + r""" + A map of the secrets that can be used in the called workflow. Within the called workflow, you can use the secrets context to refer to a secret. + """ + + [key: str]: WorkflowOnOneOf2WorkflowCallSecretsPatternProperties0 + + check: + regex.match(key, r"^[_a-zA-Z][a-zA-Z0-9_-]*$") + +schema WorkflowOnOneOf2WorkflowCallSecretsPatternProperties0: + r""" + A string identifier to associate with the secret. + + Attributes + ---------- + description : str, optional + A string description of the secret parameter. + required : any, required + A boolean specifying whether the secret must be supplied. + """ + + description?: str + required: any + +schema WorkflowOnOneOf2WorkflowDispatch: + r""" + You can now create workflows that are manually triggered with the new workflow_dispatch event. You will then see a 'Run workflow' button on the Actions tab, enabling you to easily trigger a run. + + Attributes + ---------- + inputs : WorkflowOnOneOf2WorkflowDispatchInputs, optional + Input parameters allow you to specify data that the action expects to use during runtime. GitHub stores input parameters as environment variables. Input ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase input ids. + """ + + inputs?: WorkflowOnOneOf2WorkflowDispatchInputs + +schema WorkflowOnOneOf2WorkflowDispatchInputs: + r""" + Input parameters allow you to specify data that the action expects to use during runtime. GitHub stores input parameters as environment variables. Input ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase input ids. + """ + + [key: str]: WorkflowOnOneOf2WorkflowDispatchInputsPatternProperties0 + + check: + regex.match(key, r"^[_a-zA-Z][a-zA-Z0-9_-]*$") + +schema WorkflowOnOneOf2WorkflowDispatchInputsPatternProperties0: + r""" + A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _. + + Attributes + ---------- + description : str, required + A string description of the input parameter. + deprecation_message : str, optional + A string shown to users using the deprecated input. + required : bool, required + A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required. + default : any, optional + A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file. + type : "string" | "choice" | "boolean" | "environment", optional + A string representing the type of the input. + options : [str], optional + The options of the dropdown list, if the type is a choice. + """ + + description: str + deprecation_message?: str + required: bool + default?: any + type?: "string" | "choice" | "boolean" | "environment" + options?: [str] + + check: + len(options) >= 1 + +schema WorkflowOnOneOf2WorkflowRun: + r""" + This event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow. For example, if your pull_request workflow generates build artifacts, you can create a new workflow that uses workflow_run to analyze the results and add a comment to the original pull request. + + Attributes + ---------- + types : ["requested" | "completed"], optional, default is ["requested", "completed"] + Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. + You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. + workflows : [str], optional + """ + + types?: ["requested" | "completed"] = ["requested", "completed"] + workflows?: [str] + [...str]: any + + check: + len(types) >= 1 + len(workflows) >= 1 + +schema WorkflowOnOneOf2WorkflowRunOneOf0: + r""" + WorkflowOnOneOf2WorkflowRunOneOf0 + """ + + [...str]: any + +schema WorkflowPermissionsOneOf1: + r""" + WorkflowPermissionsOneOf1 + + Attributes + ---------- + actions : "read" | "write" | "none", optional + checks : "read" | "write" | "none", optional + contents : "read" | "write" | "none", optional + deployments : "read" | "write" | "none", optional + discussions : "read" | "write" | "none", optional + id_token : "read" | "write" | "none", optional + issues : "read" | "write" | "none", optional + packages : "read" | "write" | "none", optional + pages : "read" | "write" | "none", optional + pull_requests : "read" | "write" | "none", optional + repository_projects : "read" | "write" | "none", optional + security_events : "read" | "write" | "none", optional + statuses : "read" | "write" | "none", optional + actions : "read" | "write" | "none", optional + checks : "read" | "write" | "none", optional + contents : "read" | "write" | "none", optional + deployments : "read" | "write" | "none", optional + discussions : "read" | "write" | "none", optional + id_token : "read" | "write" | "none", optional + issues : "read" | "write" | "none", optional + packages : "read" | "write" | "none", optional + pages : "read" | "write" | "none", optional + pull_requests : "read" | "write" | "none", optional + repository_projects : "read" | "write" | "none", optional + security_events : "read" | "write" | "none", optional + statuses : "read" | "write" | "none", optional + """ + + actions?: "read" | "write" | "none" + checks?: "read" | "write" | "none" + contents?: "read" | "write" | "none" + deployments?: "read" | "write" | "none" + discussions?: "read" | "write" | "none" + id_token?: "read" | "write" | "none" + issues?: "read" | "write" | "none" + packages?: "read" | "write" | "none" + pages?: "read" | "write" | "none" + pull_requests?: "read" | "write" | "none" + repository_projects?: "read" | "write" | "none" + security_events?: "read" | "write" | "none" + statuses?: "read" | "write" | "none" + actions?: "read" | "write" | "none" + checks?: "read" | "write" | "none" + contents?: "read" | "write" | "none" + deployments?: "read" | "write" | "none" + discussions?: "read" | "write" | "none" + id_token?: "read" | "write" | "none" + issues?: "read" | "write" | "none" + packages?: "read" | "write" | "none" + pages?: "read" | "write" | "none" + pull_requests?: "read" | "write" | "none" + repository_projects?: "read" | "write" | "none" + security_events?: "read" | "write" | "none" + statuses?: "read" | "write" | "none" + diff --git a/pkg/tools/gen/testdata/jsonschema/complex-workflow/input.json b/pkg/tools/gen/testdata/jsonschema/complex-workflow/input.json new file mode 100644 index 00000000..82ab0033 --- /dev/null +++ b/pkg/tools/gen/testdata/jsonschema/complex-workflow/input.json @@ -0,0 +1,1824 @@ +{ + "$id": "https://example.com/schemas/workflow.json", + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions", + "$schema": "http://json-schema.org/draft-07/schema", + "additionalProperties": false, + "definitions": { + "architecture": { + "type": "string", + "enum": [ + "ARM32", + "x64", + "x86" + ] + }, + "branch": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestbranchestags", + "$ref": "#/definitions/globs", + "description": "When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref.\nThe branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet.\nThe patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref.\nYou can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches:\n- branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names.\n- tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names.\nYou can exclude tags and branches using the ! character. The order that you define patterns matters.\n- A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref.\n- A matching positive pattern after a negative match will include the Git ref again." + }, + "concurrency": { + "type": "object", + "properties": { + "group": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run-1", + "description": "When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled.", + "type": "string" + }, + "cancel-in-progress": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run-1", + "description": "To cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ] + } + }, + "required": [ + "group" + ], + "additionalProperties": false + }, + "configuration": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/configuration" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/configuration" + } + } + ] + }, + "container": { + "type": "object", + "properties": { + "image": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerimage", + "description": "The Docker image to use as the container to run the action. The value can be the Docker Hub image name or a registry name.", + "type": "string" + }, + "credentials": { + "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainercredentials", + "description": "If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command.", + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + } + }, + "env": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerenv", + "$ref": "#/definitions/env", + "description": "Sets an array of environment variables in the container." + }, + "ports": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerports", + "description": "Sets an array of ports to expose on the container.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ] + }, + "minItems": 1 + }, + "volumes": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainervolumes", + "description": "Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host.\nTo specify a volume, you specify the source and destination path: :\nThe is a volume name or an absolute path on the host machine, and is an absolute path in the container.", + "type": "array", + "items": { + "type": "string", + "pattern": "^[^:]+:[^:]+$" + }, + "minItems": 1 + }, + "options": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontaineroptions", + "description": "Additional Docker container resource options. For a list of options, see https://docs.docker.com/engine/reference/commandline/create/#options.", + "type": "string" + } + }, + "required": [ + "image" + ], + "additionalProperties": false + }, + "defaults": { + "type": "object", + "properties": { + "run": { + "type": "object", + "properties": { + "shell": { + "$ref": "#/definitions/shell" + }, + "working-directory": { + "$ref": "#/definitions/working-directory" + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "minProperties": 1, + "additionalProperties": false + }, + "permissions": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions", + "description": "You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access.", + "oneOf": [ + { + "type": "string", + "enum": [ + "read-all", + "write-all" + ] + }, + { + "$ref": "#/definitions/permissions-event" + } + ] + }, + "permissions-event": { + "type": "object", + "additionalProperties": false, + "properties": { + "actions": { + "$ref": "#/definitions/permissions-level" + }, + "checks": { + "$ref": "#/definitions/permissions-level" + }, + "contents": { + "$ref": "#/definitions/permissions-level" + }, + "deployments": { + "$ref": "#/definitions/permissions-level" + }, + "discussions": { + "$ref": "#/definitions/permissions-level" + }, + "id-token": { + "$ref": "#/definitions/permissions-level" + }, + "issues": { + "$ref": "#/definitions/permissions-level" + }, + "packages": { + "$ref": "#/definitions/permissions-level" + }, + "pages": { + "$ref": "#/definitions/permissions-level" + }, + "pull-requests": { + "$ref": "#/definitions/permissions-level" + }, + "repository-projects": { + "$ref": "#/definitions/permissions-level" + }, + "security-events": { + "$ref": "#/definitions/permissions-level" + }, + "statuses": { + "$ref": "#/definitions/permissions-level" + } + } + }, + "permissions-level": { + "type": "string", + "enum": [ + "read", + "write", + "none" + ] + }, + "env": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/environment-variables", + "description": "To set custom environment variables, you need to specify the variables in the workflow file. You can define environment variables for a step, job, or entire workflow using the jobs..steps[*].env, jobs..env, and env keywords. For more information, see https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsenv", + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + { + "$ref": "#/definitions/expressionSyntax", + "$comment": "https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson", + "pattern": "^\\$\\{\\{\\s*fromJSON\\(.*\\)\\s*\\}\\}$" + } + ] + }, + "environment": { + "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idenvironment", + "description": "The environment that the job references", + "type": "object", + "properties": { + "name": { + "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#example-using-a-single-environment-name", + "description": "The name of the environment configured in the repo.", + "type": "string" + }, + "url": { + "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#example-using-environment-name-and-url", + "description": "A deployment URL", + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "event": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows", + "type": "string", + "enum": [ + "branch_protection_rule", + "check_run", + "check_suite", + "create", + "delete", + "deployment", + "deployment_status", + "discussion", + "discussion_comment", + "fork", + "gollum", + "issue_comment", + "issues", + "label", + "member", + "milestone", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "pull_request_target", + "push", + "registry_package", + "release", + "status", + "watch", + "workflow_call", + "workflow_dispatch", + "workflow_run", + "repository_dispatch" + ] + }, + "eventObject": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "additionalProperties": true + }, + "expressionSyntax": { + "type": "string", + "$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)", + "pattern": "^\\$\\{\\{.*\\}\\}$" + }, + "stringContainingExpressionSyntax": { + "type": "string", + "$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)", + "pattern": "^.*\\$\\{\\{.*\\}\\}.*$" + }, + "globs": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1 + }, + "machine": { + "type": "string", + "enum": [ + "linux", + "macos", + "windows" + ] + }, + "name": { + "type": "string", + "pattern": "^[_a-zA-Z][a-zA-Z0-9_-]*$" + }, + "path": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths", + "$ref": "#/definitions/globs", + "description": "When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. Path filters are not evaluated for pushes to tags.\nThe paths-ignore and paths keywords accept glob patterns that use the * and ** wildcard characters to match more than one path name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet.\nYou can exclude paths using two types of filters. You cannot use both of these filters for the same event in a workflow.\n- paths-ignore - Use the paths-ignore filter when you only need to exclude path names.\n- paths - Use the paths filter when you need to filter paths for positive matches and exclude paths." + }, + "ref": { + "properties": { + "branches": { + "$ref": "#/definitions/branch" + }, + "branches-ignore": { + "$ref": "#/definitions/branch" + }, + "tags": { + "$ref": "#/definitions/branch" + }, + "tags-ignore": { + "$ref": "#/definitions/branch" + }, + "paths": { + "$ref": "#/definitions/path" + }, + "paths-ignore": { + "$ref": "#/definitions/path" + } + }, + "oneOf": [ + { + "type": "object", + "allOf": [ + { + "not": { + "required": [ + "branches", + "branches-ignore" + ] + } + }, + { + "not": { + "required": [ + "tags", + "tags-ignore" + ] + } + }, + { + "not": { + "required": [ + "paths", + "paths-ignore" + ] + } + } + ] + }, + { + "type": "null" + } + ] + }, + "shell": { + "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell", + "description": "You can override the default shell settings in the runner's operating system using the shell keyword. You can use built-in shell keywords, or you can define a custom set of shell options.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#custom-shell", + "enum": [ + "bash", + "pwsh", + "python", + "sh", + "cmd", + "powershell" + ] + } + ] + }, + "types": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onevent_nametypes", + "description": "Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary.\nYou can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events.", + "type": "array", + "minItems": 1 + }, + "working-directory": { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun", + "description": "Using the working-directory keyword, you can specify the working directory of where to run the command.", + "type": "string" + }, + "jobNeeds": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idneeds", + "description": "Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue.", + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/name" + }, + "minItems": 1 + }, + { + "$ref": "#/definitions/name" + } + ] + }, + "reusableWorkflowCallJob": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#calling-a-reusable-workflow", + "description": "Each job must have an id to associate with the job. The key job_id is a string and its value is a map of the job's configuration data. You must replace with a string that is unique to the jobs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "name": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname", + "description": "The name of the job displayed on GitHub.", + "type": "string" + }, + "needs": { + "$ref": "#/definitions/jobNeeds" + }, + "permissions": { + "$ref": "#/definitions/permissions-event" + }, + "if": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idif", + "description": "You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "type": "string" + }, + "uses": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_iduses", + "description": "The location and version of a reusable workflow file to run as a job, of the form './{path/to}/{localfile}.yml' or '{owner}/{repo}/{path}/{filename}@{ref}'. {ref} can be a SHA, a release tag, or a branch name. Using the commit SHA is the safest for stability and security.", + "type": "string", + "pattern": "^(.+/)+(.+)\\.(ya?ml)(@.+)?$" + }, + "with": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idwith", + "description": "A map of inputs that are passed to the called workflow. Any inputs that you pass must match the input specifications defined in the called workflow. Unlike 'jobs..steps[*].with', the inputs you pass with 'jobs..with' are not be available as environment variables in the called workflow. Instead, you can reference the inputs by using the inputs context.", + "$ref": "#/definitions/env" + }, + "secrets": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idsecrets", + "description": "When a job is used to call a reusable workflow, you can use 'secrets' to provide a map of secrets that are passed to the called workflow. Any secrets that you pass must match the names defined in the called workflow.", + "oneOf": [ + { + "$ref": "#/definitions/env" + }, + { + "type": "string", + "enum": [ + "inherit" + ] + } + ] + }, + "concurrency": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency", + "description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/concurrency" + } + ] + } + }, + "required": [ + "uses" + ], + "additionalProperties": false + }, + "normalJob": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_id", + "description": "Each job must have an id to associate with the job. The key job_id is a string and its value is a map of the job's configuration data. You must replace with a string that is unique to the jobs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "name": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname", + "description": "The name of the job displayed on GitHub.", + "type": "string" + }, + "needs": { + "$ref": "#/definitions/jobNeeds" + }, + "permissions": { + "$ref": "#/definitions/permissions" + }, + "runs-on": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on", + "description": "The type of machine to run the job on. The machine can be either a GitHub-hosted runner, or a self-hosted runner.", + "oneOf": [ + { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#github-hosted-runners", + "type": "string", + "enum": [ + "macos-10.15", + "macos-11", + "macos-12", + "macos-latest", + "self-hosted", + "ubuntu-18.04", + "ubuntu-20.04", + "ubuntu-22.04", + "ubuntu-latest", + "windows-2016", + "windows-2019", + "windows-2022", + "windows-latest" + ] + }, + { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#self-hosted-runners", + "type": "array", + "anyOf": [ + { + "items": [ + { + "const": "self-hosted" + } + ], + "minItems": 1, + "additionalItems": { + "type": "string" + } + }, + { + "items": [ + { + "const": "self-hosted" + }, + { + "$ref": "#/definitions/machine" + } + ], + "minItems": 2, + "additionalItems": { + "type": "string" + } + }, + { + "items": [ + { + "const": "self-hosted" + }, + { + "$ref": "#/definitions/architecture" + } + ], + "minItems": 2, + "additionalItems": { + "type": "string" + } + }, + { + "items": [ + { + "const": "self-hosted" + }, + { + "$ref": "#/definitions/machine" + }, + { + "$ref": "#/definitions/architecture" + } + ], + "minItems": 3, + "additionalItems": { + "type": "string" + } + }, + { + "items": [ + { + "const": "self-hosted" + }, + { + "$ref": "#/definitions/architecture" + }, + { + "$ref": "#/definitions/machine" + } + ], + "minItems": 3, + "additionalItems": { + "type": "string" + } + } + ] + }, + { + "$ref": "#/definitions/stringContainingExpressionSyntax" + } + ] + }, + "environment": { + "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idenvironment", + "description": "The environment that the job references.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/environment" + } + ] + }, + "outputs": { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjobs_idoutputs", + "description": "A map of outputs for a job. Job outputs are available to all downstream jobs that depend on this job.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "minProperties": 1 + }, + "env": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idenv", + "$ref": "#/definitions/env", + "description": "A map of environment variables that are available to all steps in the job." + }, + "defaults": { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaults", + "$ref": "#/definitions/defaults", + "description": "A map of default settings that will apply to all steps in the job." + }, + "if": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idif", + "description": "You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "type": "string" + }, + "steps": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idsteps", + "description": "A job contains a sequence of tasks called steps. Steps can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry. Not all steps run actions, but all actions run as a step. Each step runs in its own process in the virtual environment and has access to the workspace and filesystem. Because steps run in their own process, changes to environment variables are not preserved between steps. GitHub provides built-in steps to set up and complete a job.\n", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsid", + "description": "A unique identifier for the step. You can use the id to reference the step in contexts. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "type": "string" + }, + "if": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsif", + "description": "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "type": "string" + }, + "name": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsname", + "description": "A name for your step to display on GitHub.", + "type": "string" + }, + "uses": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsuses", + "description": "Selects an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image (https://hub.docker.com/).\nWe strongly recommend that you include the version of the action you are using by specifying a Git ref, SHA, or Docker tag number. If you don't specify a version, it could break your workflows or cause unexpected behavior when the action owner publishes an update.\n- Using the commit SHA of a released action version is the safest for stability and security.\n- Using the specific major action version allows you to receive critical fixes and security patches while still maintaining compatibility. It also assures that your workflow should still work.\n- Using the master branch of an action may be convenient, but if someone releases a new major version with a breaking change, your workflow could break.\nSome actions require inputs that you must set using the with keyword. Review the action's README file to determine the inputs required.\nActions are either JavaScript files or Docker containers. If the action you're using is a Docker container you must run the job in a Linux virtual environment. For more details, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", + "type": "string" + }, + "run": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsrun", + "description": "Runs command-line programs using the operating system's shell. If you do not provide a name, the step name will default to the text specified in the run command.\nCommands run using non-login shells by default. You can choose a different shell and customize the shell used to run commands. For more information, see https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell.\nEach run keyword represents a new process and shell in the virtual environment. When you provide multi-line commands, each line runs in the same shell.", + "type": "string" + }, + "working-directory": { + "$ref": "#/definitions/working-directory" + }, + "shell": { + "$ref": "#/definitions/shell" + }, + "with": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswith", + "$ref": "#/definitions/env", + "description": "A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case.", + "properties": { + "args": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswithargs", + "type": "string" + }, + "entrypoint": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswithentrypoint", + "type": "string" + } + } + }, + "env": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsenv", + "$ref": "#/definitions/env", + "description": "Sets environment variables for steps to use in the virtual environment. You can also set environment variables for the entire workflow or a job." + }, + "continue-on-error": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error", + "description": "Prevents a job from failing when a step fails. Set to true to allow a job to pass when this step fails.", + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ], + "default": false + }, + "timeout-minutes": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepstimeout-minutes", + "description": "The maximum number of minutes to run the step before killing the process.", + "type": "number" + } + }, + "dependencies": { + "working-directory": [ + "run" + ], + "shell": [ + "run" + ] + }, + "additionalProperties": false + }, + "minItems": 1 + }, + "timeout-minutes": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes", + "description": "The maximum number of minutes to let a workflow run before GitHub automatically cancels it. Default: 360", + "type": "number", + "default": 360 + }, + "strategy": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategy", + "description": "A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in.", + "type": "object", + "properties": { + "matrix": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix", + "description": "A build matrix is a set of different configurations of the virtual environment. For example you might run a job against more than one supported version of a language, operating system, or tool. Each configuration is a copy of the job that runs and reports a status.\nYou can specify a matrix by supplying an array for the configuration options. For example, if the GitHub virtual environment supports Node.js versions 6, 8, and 10 you could specify an array of those versions in the matrix.\nWhen you define a matrix of operating systems, you must set the required runs-on keyword to the operating system of the current job, rather than hard-coding the operating system name. To access the operating system name, you can use the matrix.os context parameter to set runs-on. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "oneOf": [ + { + "type": "object" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ], + "patternProperties": { + "^(in|ex)clude$": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build", + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/configuration" + } + }, + "minItems": 1 + } + }, + "additionalProperties": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/configuration" + }, + "minItems": 1 + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ] + }, + "minProperties": 1 + }, + "fail-fast": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast", + "description": "When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true", + "type": "boolean", + "default": true + }, + "max-parallel": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymax-parallel", + "description": "The maximum number of jobs that can run simultaneously when using a matrix job strategy. By default, GitHub will maximize the number of jobs run in parallel depending on the available runners on GitHub-hosted virtual machines.", + "type": "number" + } + }, + "required": [ + "matrix" + ], + "additionalProperties": false + }, + "continue-on-error": { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error", + "description": "Prevents a workflow run from failing when a job fails. Set to true to allow a workflow run to pass when this job fails.", + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ] + }, + "container": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainer", + "description": "A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts.\nIf you do not set a container, all steps will run directly on the host specified by runs-on unless a step refers to an action configured to run in a container.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/container" + } + ] + }, + "services": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idservices", + "description": "Additional containers to host services for a job in a workflow. These are useful for creating databases or cache services like redis. The runner on the virtual machine will automatically create a network and manage the life cycle of the service containers.\nWhen you use a service container for a job or your step uses container actions, you don't need to set port information to access the service. Docker automatically exposes all ports between containers on the same network.\nWhen both the job and the action run in a container, you can directly reference the container by its hostname. The hostname is automatically mapped to the service name.\nWhen a step does not use a container action, you must access the service using localhost and bind the ports.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/container" + } + }, + "concurrency": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency", + "description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/concurrency" + } + ] + } + }, + "required": [ + "runs-on" + ], + "additionalProperties": false + } + }, + "properties": { + "name": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#name", + "description": "The name of your workflow. GitHub displays the names of your workflows on your repository's actions page. If you omit this field, GitHub sets the name to the workflow's filename.", + "type": "string" + }, + "on": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#on", + "description": "The name of the GitHub event that triggers the workflow. You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow to specific files, tags, or branch changes. For a list of available events, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows.", + "oneOf": [ + { + "$ref": "#/definitions/event" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/event" + }, + "minItems": 1 + }, + { + "type": "object", + "properties": { + "branch_protection_rule": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#branch_protection_rule", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the branch_protection_rule event occurs. More than one activity type triggers this event.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "edited", + "deleted" + ] + }, + "default": [ + "created", + "edited", + "deleted" + ] + } + } + }, + "check_run": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#check-run-event-check_run", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the check_run event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/runs.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "rerequested", + "completed", + "requested_action" + ] + }, + "default": [ + "created", + "rerequested", + "completed", + "requested_action" + ] + } + } + }, + "check_suite": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#check-suite-event-check_suite", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the check_suite event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/suites/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "completed", + "requested", + "rerequested" + ] + }, + "default": [ + "completed", + "requested", + "rerequested" + ] + } + } + }, + "create": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#create-event-create", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime someone creates a branch or tag, which triggers the create event. For information about the REST API, see https://developer.github.com/v3/git/refs/#create-a-reference." + }, + "delete": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#delete-event-delete", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime someone deletes a branch or tag, which triggers the delete event. For information about the REST API, see https://developer.github.com/v3/git/refs/#delete-a-reference." + }, + "deployment": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#deployment-event-deployment", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime someone creates a deployment, which triggers the deployment event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/." + }, + "deployment_status": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#deployment-status-event-deployment_status", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime a third party provides a deployment status, which triggers the deployment_status event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/#create-a-deployment-status." + }, + "discussion": { + "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#discussion", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the discussion event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "edited", + "deleted", + "transferred", + "pinned", + "unpinned", + "labeled", + "unlabeled", + "locked", + "unlocked", + "category_changed", + "answered", + "unanswered" + ] + }, + "default": [ + "created", + "edited", + "deleted", + "transferred", + "pinned", + "unpinned", + "labeled", + "unlabeled", + "locked", + "unlocked", + "category_changed", + "answered", + "unanswered" + ] + } + } + }, + "discussion_comment": { + "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#discussion_comment", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the discussion_comment event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "edited", + "deleted" + ] + }, + "default": [ + "created", + "edited", + "deleted" + ] + } + } + }, + "fork": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#fork-event-fork", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime when someone forks a repository, which triggers the fork event. For information about the REST API, see https://developer.github.com/v3/repos/forks/#create-a-fork." + }, + "gollum": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#gollum-event-gollum", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow when someone creates or updates a Wiki page, which triggers the gollum event." + }, + "issue_comment": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#issue-comment-event-issue_comment", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the issue_comment event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/comments/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "edited", + "deleted" + ] + }, + "default": [ + "created", + "edited", + "deleted" + ] + } + } + }, + "issues": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#issues-event-issues", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the issues event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "opened", + "edited", + "deleted", + "transferred", + "pinned", + "unpinned", + "closed", + "reopened", + "assigned", + "unassigned", + "labeled", + "unlabeled", + "locked", + "unlocked", + "milestoned", + "demilestoned" + ] + }, + "default": [ + "opened", + "edited", + "deleted", + "transferred", + "pinned", + "unpinned", + "closed", + "reopened", + "assigned", + "unassigned", + "labeled", + "unlabeled", + "locked", + "unlocked", + "milestoned", + "demilestoned" + ] + } + } + }, + "label": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#label-event-label", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the label event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/labels/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "edited", + "deleted" + ] + }, + "default": [ + "created", + "edited", + "deleted" + ] + } + } + }, + "member": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#member-event-member", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the member event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/collaborators/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "added", + "edited", + "deleted" + ] + }, + "default": [ + "added", + "edited", + "deleted" + ] + } + } + }, + "milestone": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#milestone-event-milestone", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the milestone event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/milestones/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "closed", + "opened", + "edited", + "deleted" + ] + }, + "default": [ + "created", + "closed", + "opened", + "edited", + "deleted" + ] + } + } + }, + "page_build": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#page-build-event-page_build", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime someone pushes to a GitHub Pages-enabled branch, which triggers the page_build event. For information about the REST API, see https://developer.github.com/v3/repos/pages/." + }, + "project": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#project-event-project", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the project event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "updated", + "closed", + "reopened", + "edited", + "deleted" + ] + }, + "default": [ + "created", + "updated", + "closed", + "reopened", + "edited", + "deleted" + ] + } + } + }, + "project_card": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#project-card-event-project_card", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the project_card event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/cards.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "moved", + "converted", + "edited", + "deleted" + ] + }, + "default": [ + "created", + "moved", + "converted", + "edited", + "deleted" + ] + } + } + }, + "project_column": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#project-column-event-project_column", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the project_column event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/columns.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "updated", + "moved", + "deleted" + ] + }, + "default": [ + "created", + "updated", + "moved", + "deleted" + ] + } + } + }, + "public": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#public-event-public", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime someone makes a private repository public, which triggers the public event. For information about the REST API, see https://developer.github.com/v3/repos/#edit." + }, + "pull_request": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-event-pull_request", + "$ref": "#/definitions/ref", + "description": "Runs your workflow anytime the pull_request event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls.\nNote: Workflows do not run on private base repositories when you open a pull request from a forked repository.\nWhen you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.\nWorkflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.\nThe permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "assigned", + "unassigned", + "labeled", + "unlabeled", + "opened", + "edited", + "closed", + "reopened", + "synchronize", + "converted_to_draft", + "ready_for_review", + "locked", + "unlocked", + "review_requested", + "review_request_removed", + "auto_merge_enabled", + "auto_merge_disabled" + ] + }, + "default": [ + "opened", + "synchronize", + "reopened" + ] + } + }, + "patternProperties": { + "^(branche|tag|path)s(-ignore)?$": { + "type": "array" + } + }, + "additionalProperties": false + }, + "pull_request_review": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-review-event-pull_request_review", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the pull_request_review event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/reviews.\nNote: Workflows do not run on private base repositories when you open a pull request from a forked repository.\nWhen you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.\nWorkflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.\nThe permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "submitted", + "edited", + "dismissed" + ] + }, + "default": [ + "submitted", + "edited", + "dismissed" + ] + } + } + }, + "pull_request_review_comment": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-review-comment-event-pull_request_review_comment", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime a comment on a pull request's unified diff is modified, which triggers the pull_request_review_comment event. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/comments.\nNote: Workflows do not run on private base repositories when you open a pull request from a forked repository.\nWhen you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.\nWorkflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.\nThe permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "edited", + "deleted" + ] + }, + "default": [ + "created", + "edited", + "deleted" + ] + } + } + }, + "pull_request_target": { + "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target", + "$ref": "#/definitions/ref", + "description": "This event is similar to pull_request, except that it runs in the context of the base repository of the pull request, rather than in the merge commit. This means that you can more safely make your secrets available to the workflows triggered by the pull request, because only workflows defined in the commit on the base repository are run. For example, this event allows you to create workflows that label and comment on pull requests, based on the contents of the event payload.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "assigned", + "unassigned", + "labeled", + "unlabeled", + "opened", + "edited", + "closed", + "reopened", + "synchronize", + "converted_to_draft", + "ready_for_review", + "locked", + "unlocked", + "review_requested", + "review_request_removed", + "auto_merge_enabled", + "auto_merge_disabled" + ] + }, + "default": [ + "opened", + "synchronize", + "reopened" + ] + } + }, + "patternProperties": { + "^(branche|tag|path)s(-ignore)?$": {} + }, + "additionalProperties": false + }, + "push": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#push-event-push", + "$ref": "#/definitions/ref", + "description": "Runs your workflow when someone pushes to a repository branch, which triggers the push event.\nNote: The webhook payload available to GitHub Actions does not include the added, removed, and modified attributes in the commit object. You can retrieve the full commit object using the REST API. For more information, see https://developer.github.com/v3/repos/commits/#get-a-single-commit.", + "patternProperties": { + "^(branche|tag|path)s(-ignore)?$": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false + }, + "registry_package": { + "$comment": "https://help.github.com/en/actions/reference/events-that-trigger-workflows#registry-package-event-registry_package", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime a package is published or updated. For more information, see https://help.github.com/en/github/managing-packages-with-github-packages.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "published", + "updated" + ] + }, + "default": [ + "published", + "updated" + ] + } + } + }, + "release": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#release-event-release", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the release event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/releases/ in the GitHub Developer documentation.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "published", + "unpublished", + "created", + "edited", + "deleted", + "prereleased", + "released" + ] + }, + "default": [ + "published", + "unpublished", + "created", + "edited", + "deleted", + "prereleased", + "released" + ] + } + } + }, + "status": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#status-event-status", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the status of a Git commit changes, which triggers the status event. For information about the REST API, see https://developer.github.com/v3/repos/statuses/." + }, + "watch": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#watch-event-watch", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the watch event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/activity/starring/." + }, + "workflow_call": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#workflow_call", + "description": "Allows workflows to be reused by other workflows.", + "properties": { + "inputs": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs", + "description": "When using the workflow_call keyword, you can optionally specify inputs that are passed to the called workflow from the caller workflow.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_id", + "description": "A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "description": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", + "description": "A string description of the input parameter.", + "type": "string" + }, + "deprecationMessage": { + "description": "A string shown to users using the deprecated input.", + "type": "string" + }, + "required": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", + "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.", + "type": "boolean" + }, + "type": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callinput_idtype", + "description": "Required if input is defined for the on.workflow_call keyword. The value of this parameter is a string specifying the data type of the input. This must be one of: boolean, number, or string.", + "type": "string", + "enum": [ + "boolean", + "number", + "string" + ] + }, + "default": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", + "description": "The default value is used when an input parameter isn't specified in a workflow file.", + "type": [ + "boolean", + "number", + "string" + ] + } + }, + "required": [ + "required", + "type" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "secrets": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callsecrets", + "description": "A map of the secrets that can be used in the called workflow. Within the called workflow, you can use the secrets context to refer to a secret.", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callsecretssecret_id", + "description": "A string identifier to associate with the secret.", + "properties": { + "description": { + "description": "A string description of the secret parameter.", + "type": "string" + }, + "required": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callsecretssecret_idrequired", + "description": "A boolean specifying whether the secret must be supplied." + } + }, + "required": [ + "required" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + }, + "workflow_dispatch": { + "$comment": "https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/", + "description": "You can now create workflows that are manually triggered with the new workflow_dispatch event. You will then see a 'Run workflow' button on the Actions tab, enabling you to easily trigger a run.", + "properties": { + "inputs": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputs", + "description": "Input parameters allow you to specify data that the action expects to use during runtime. GitHub stores input parameters as environment variables. Input ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase input ids.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_id", + "description": "A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "description": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", + "description": "A string description of the input parameter.", + "type": "string" + }, + "deprecationMessage": { + "description": "A string shown to users using the deprecated input.", + "type": "string" + }, + "required": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", + "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.", + "type": "boolean" + }, + "default": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", + "description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file." + }, + "type": { + "description": "A string representing the type of the input.", + "type": "string", + "enum": [ + "string", + "choice", + "boolean", + "environment" + ] + }, + "options": { + "$comment": "https://github.blog/changelog/2021-11-10-github-actions-input-types-for-manual-workflows", + "description": "The options of the dropdown list, if the type is a choice.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "boolean" + } + }, + "required": [ + "type" + ] + }, + "then": { + "properties": { + "default": { + "type": "boolean" + } + } + }, + "else": { + "properties": { + "default": { + "type": "string" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "choice" + } + }, + "required": [ + "type" + ] + }, + "then": { + "required": [ + "options" + ] + } + } + ], + "required": [ + "description", + "required" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + }, + "workflow_run": { + "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run", + "$ref": "#/definitions/eventObject", + "description": "This event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow. For example, if your pull_request workflow generates build artifacts, you can create a new workflow that uses workflow_run to analyze the results and add a comment to the original pull request.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "requested", + "completed" + ] + }, + "default": [ + "requested", + "completed" + ] + }, + "workflows": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "patternProperties": { + "^branches(-ignore)?$": {} + } + }, + "repository_dispatch": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#external-events-repository_dispatch", + "$ref": "#/definitions/eventObject", + "description": "You can use the GitHub API to trigger a webhook event called repository_dispatch when you want to trigger a workflow for activity that happens outside of GitHub. For more information, see https://developer.github.com/v3/repos/#create-a-repository-dispatch-event.\nTo trigger the custom repository_dispatch webhook event, you must send a POST request to a GitHub API endpoint and provide an event_type name to describe the activity type. To trigger a workflow run, you must also configure your workflow to use the repository_dispatch event." + }, + "schedule": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#scheduled-events-schedule", + "description": "You can schedule a workflow to run at specific UTC times using POSIX cron syntax (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07). Scheduled workflows run on the latest commit on the default or base branch. The shortest interval you can run scheduled workflows is once every 5 minutes.\nNote: GitHub Actions does not support the non-standard syntax @yearly, @monthly, @weekly, @daily, @hourly, and @reboot.\nYou can use crontab guru (https://crontab.guru/). to help generate your cron syntax and confirm what time it will run. To help you get started, there is also a list of crontab guru examples (https://crontab.guru/examples.html).", + "type": "array", + "items": { + "properties": { + "cron": { + "$comment": "https://stackoverflow.com/a/57639657/4044345", + "type": "string", + "pattern": "^(((\\d+,)+\\d+|((\\d+|\\*)/\\d+|((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?))|(\\d+-\\d+)|\\d+|\\*|((MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?)) ?){5}$" + } + }, + "additionalProperties": false + }, + "minItems": 1 + } + }, + "additionalProperties": false + } + ] + }, + "env": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#env", + "$ref": "#/definitions/env", + "description": "A map of environment variables that are available to all jobs and steps in the workflow." + }, + "defaults": { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaults", + "$ref": "#/definitions/defaults", + "description": "A map of default settings that will apply to all jobs in the workflow." + }, + "concurrency": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency", + "description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/concurrency" + } + ] + }, + "jobs": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobs", + "description": "A workflow run is made up of one or more jobs. Jobs run in parallel by default. To run jobs sequentially, you can define dependencies on other jobs using the jobs..needs keyword.\nEach job runs in a fresh instance of the virtual environment specified by runs-on.\nYou can run an unlimited number of jobs as long as you are within the workflow usage limits. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#usage-limits.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "oneOf": [ + { + "$ref": "#/definitions/normalJob" + }, + { + "$ref": "#/definitions/reusableWorkflowCallJob" + } + ] + } + }, + "minProperties": 1, + "additionalProperties": false + }, + "permissions": { + "$ref": "#/definitions/permissions" + } + }, + "required": [ + "on", + "jobs" + ], + "type": "object" +} diff --git a/pkg/tools/gen/testdata/jsonschema/oneof/expect.k b/pkg/tools/gen/testdata/jsonschema/oneof/expect.k new file mode 100644 index 00000000..6eb20e47 --- /dev/null +++ b/pkg/tools/gen/testdata/jsonschema/oneof/expect.k @@ -0,0 +1,42 @@ +""" +This file was generated by the KCL auto-gen tool. DO NOT EDIT. +Editing this file might prove futile when you re-run the KCL auto-gen generate command. +""" + +schema Book: + r""" + Book + + Attributes + ---------- + title : str, optional + author : str | [str] | int, optional + category : BookCategoryOneOf0 | BookCategoryOneOf1, optional + """ + + title?: str + author?: str | [str] | int + category?: BookCategoryOneOf0 | BookCategoryOneOf1 + +schema BookCategoryOneOf0: + r""" + BookCategoryOneOf0 + + Attributes + ---------- + name : str, optional + """ + + name?: str + +schema BookCategoryOneOf1: + r""" + BookCategoryOneOf1 + + Attributes + ---------- + title : str, optional + """ + + title?: str + diff --git a/pkg/tools/gen/testdata/jsonschema/oneof/input.json b/pkg/tools/gen/testdata/jsonschema/oneof/input.json new file mode 100644 index 00000000..68979be5 --- /dev/null +++ b/pkg/tools/gen/testdata/jsonschema/oneof/input.json @@ -0,0 +1,48 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://example.com/schemas/book.json", + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "author": { + "$comment": "oneOf for types", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "integer" + } + ] + }, + "category": { + "$comment": "oneOf for objects", + "oneOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "title": { + "type": "string" + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/pkg/tools/gen/testdata/jsonschema/pattern-props/expect.k b/pkg/tools/gen/testdata/jsonschema/pattern-props/expect.k new file mode 100644 index 00000000..248c30f0 --- /dev/null +++ b/pkg/tools/gen/testdata/jsonschema/pattern-props/expect.k @@ -0,0 +1,41 @@ +""" +This file was generated by the KCL auto-gen tool. DO NOT EDIT. +Editing this file might prove futile when you re-run the KCL auto-gen generate command. +""" + +schema Book: + r""" + Book + + Attributes + ---------- + title : str, required + authors : BookAuthors, optional + """ + + title: str + authors?: BookAuthors + +schema BookAuthors: + r""" + BookAuthors + """ + + [key: str]: BookAuthorsPatternProperties0 + + check: + regex.match(key, r"^[a-zA-Z]+$") + +schema BookAuthorsPatternProperties0: + r""" + BookAuthorsPatternProperties0 + + Attributes + ---------- + first_name : str, optional + last_name : str, optional + """ + + first_name?: str + last_name?: str + diff --git a/pkg/tools/gen/testdata/jsonschema/pattern-props/input.json b/pkg/tools/gen/testdata/jsonschema/pattern-props/input.json new file mode 100644 index 00000000..56332108 --- /dev/null +++ b/pkg/tools/gen/testdata/jsonschema/pattern-props/input.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://example.com/schemas/book.json", + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "authors": { + "patternProperties": { + "^[a-zA-Z]+$": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } + }, + "required": [ + "title" + ] +} \ No newline at end of file diff --git a/pkg/tools/gen/testdata/jsonschema/ref/expect.k b/pkg/tools/gen/testdata/jsonschema/ref/expect.k index 206d9870..e0adab5d 100644 --- a/pkg/tools/gen/testdata/jsonschema/ref/expect.k +++ b/pkg/tools/gen/testdata/jsonschema/ref/expect.k @@ -10,28 +10,28 @@ schema Customer: Attributes ---------- name : str, optional - address : Address, optional + address : CustomerAddress, optional """ name?: str - address?: Address + address?: CustomerAddress -schema Address: +schema CustomerAddress: r""" - Address + CustomerAddress Attributes ---------- city : str, optional - state : State, optional + state : CustomerAddressState, optional """ city?: str - state?: State + state?: CustomerAddressState -schema State: +schema CustomerAddressState: r""" - State + CustomerAddressState Attributes ---------- diff --git a/pkg/tools/gen/testdata/jsonschema/unsupport-multi-pattern-props/expect.k b/pkg/tools/gen/testdata/jsonschema/unsupport-multi-pattern-props/expect.k new file mode 100644 index 00000000..61f53e33 --- /dev/null +++ b/pkg/tools/gen/testdata/jsonschema/unsupport-multi-pattern-props/expect.k @@ -0,0 +1,49 @@ +""" +This file was generated by the KCL auto-gen tool. DO NOT EDIT. +Editing this file might prove futile when you re-run the KCL auto-gen generate command. +""" + +schema Book: + r""" + Book + + Attributes + ---------- + title : str, required + authors : BookAuthors, optional + """ + + title: str + authors?: BookAuthors + +schema BookAuthors: + r""" + BookAuthors + """ + + [...str]: any + +schema BookAuthorsPatternProperties0: + r""" + BookAuthorsPatternProperties0 + + Attributes + ---------- + name : str, optional + """ + + name?: str + +schema BookAuthorsPatternProperties1: + r""" + BookAuthorsPatternProperties1 + + Attributes + ---------- + first_name : str, optional + last_name : str, optional + """ + + first_name?: str + last_name?: str + diff --git a/pkg/tools/gen/testdata/jsonschema/unsupport-multi-pattern-props/input.json b/pkg/tools/gen/testdata/jsonschema/unsupport-multi-pattern-props/input.json new file mode 100644 index 00000000..4cf5209d --- /dev/null +++ b/pkg/tools/gen/testdata/jsonschema/unsupport-multi-pattern-props/input.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://example.com/schemas/book.json", + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "authors": { + "patternProperties": { + "^[a-zA-Z]+$": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + }, + "^[0-9]+$": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + }, + "additionalProperties": true + } + }, + "required": [ + "title" + ] +} \ No newline at end of file diff --git a/pkg/tools/gen/testdata/jsonschema/unsupport/expect.k b/pkg/tools/gen/testdata/jsonschema/unsupport/expect.k deleted file mode 100644 index d1463b9a..00000000 --- a/pkg/tools/gen/testdata/jsonschema/unsupport/expect.k +++ /dev/null @@ -1,40 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - -schema Shop: - r""" - Schema for representing a shop information. - In this test case, we use some logic keywords like "oneOf" that can't be directly converted at the moment. To make it still work, we'll convert it into "any" type. - - Attributes - ---------- - products : any, optional - """ - - products?: any - -schema Clothing: - r""" - Clothing - """ - - [...str]: any - -schema Product: - r""" - Product - - Attributes - ---------- - name : str, optional - price : float, optional - """ - - name?: str - price?: float - - check: - price >= 0 - diff --git a/pkg/tools/gen/types.go b/pkg/tools/gen/types.go index a259b799..19be039a 100644 --- a/pkg/tools/gen/types.go +++ b/pkg/tools/gen/types.go @@ -189,8 +189,9 @@ type validation struct { // indexSignature is a kcl schema index signature definition. // It can be used to construct a dict with type. type indexSignature struct { - Alias string - Type typeInterface + Alias string + Type typeInterface + validation *validation } // data is a kcl data definition.