MCPcopy Index your code
hub / github.com/rhysd/actionlint / parseWorkflowCallEventInput

Method parseWorkflowCallEventInput

parse.go:542–579  ·  view source on GitHub ↗

https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callinputs

(id string, name *String, n *yaml.Node)

Source from the content-addressed store, hash-verified

540
541// https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callinputs
542func (p *parser) parseWorkflowCallEventInput(id string, name *String, n *yaml.Node) *WorkflowCallEventInput {
543 ret := &WorkflowCallEventInput{Name: name, ID: id}
544 typed := false
545
546 for e := range p.parseMappingAt("input of workflow_call event", n, true, true) {
547 switch e.id {
548 case "description":
549 ret.Description = p.parseString(e.val, true)
550 case "required":
551 ret.Required = p.parseBool(e.val)
552 case "default":
553 ret.Default = p.parseString(e.val, true)
554 case "type":
555 typed = true
556 if !p.checkString(e.val, false) {
557 continue
558 }
559 switch e.val.Value {
560 case "boolean":
561 ret.Type = WorkflowCallEventInputTypeBoolean
562 case "number":
563 ret.Type = WorkflowCallEventInputTypeNumber
564 case "string":
565 ret.Type = WorkflowCallEventInputTypeString
566 default:
567 p.errorf(e.val, "invalid value %q for input type of workflow_call event. it must be one of \"boolean\", \"number\", or \"string\"", e.val.Value)
568 }
569 default:
570 p.unexpectedKey(e.key, "inputs at workflow_call event", []string{"description", "required", "default", "type"})
571 }
572 }
573
574 if !typed {
575 p.errorfAt(name.Pos, "\"type\" is missing at %q input of workflow_call event", name.Value)
576 }
577
578 return ret
579}
580
581// https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-of-onworkflow_callsecrets
582func (p *parser) parseWorkflowCallEventSecret(name *String, n *yaml.Node) *WorkflowCallEventSecret {

Callers 1

Calls 7

parseMappingAtMethod · 0.95
parseStringMethod · 0.95
parseBoolMethod · 0.95
checkStringMethod · 0.95
errorfMethod · 0.95
unexpectedKeyMethod · 0.95
errorfAtMethod · 0.95

Tested by

no test coverage detected