(name *String, n *yaml.Node)
| 491 | } |
| 492 | |
| 493 | func (p *parser) parseWebhookEvent(name *String, n *yaml.Node) *WebhookEvent { |
| 494 | ret := &WebhookEvent{Hook: name, Pos: name.Pos} |
| 495 | |
| 496 | // Note: 'tags', 'tags-ignore', 'branches', 'branches-ignore' can be empty. Since there are |
| 497 | // some cases where setting empty values to them is necessary. |
| 498 | // |
| 499 | // > If only define only tags filter (tags/tags-ignore) or only branches filter |
| 500 | // > (branches/branches-ignore) for on.push, the workflow won’t run for events affecting the |
| 501 | // > undefined Git ref. |
| 502 | // |
| 503 | // https://github.community/t/using-on-push-tags-ignore-and-paths-ignore-together/16931 |
| 504 | for e := range p.parseSectionMapping(name.Value, n, true, true) { |
| 505 | // Note: Glob pattern cannot be empty, but it is checked by 'glob' rule with better error |
| 506 | // message. So parser allows empty patterns here. |
| 507 | switch e.id { |
| 508 | case "types": |
| 509 | ret.Types = p.parseStringOrStringSequence(e.key.Value, e.val, false, false) |
| 510 | case "branches": |
| 511 | ret.Branches = p.parseWebhookEventFilter(e.key, e.val) |
| 512 | case "branches-ignore": |
| 513 | ret.BranchesIgnore = p.parseWebhookEventFilter(e.key, e.val) |
| 514 | case "tags": |
| 515 | ret.Tags = p.parseWebhookEventFilter(e.key, e.val) |
| 516 | case "tags-ignore": |
| 517 | ret.TagsIgnore = p.parseWebhookEventFilter(e.key, e.val) |
| 518 | case "paths": |
| 519 | ret.Paths = p.parseWebhookEventFilter(e.key, e.val) |
| 520 | case "paths-ignore": |
| 521 | ret.PathsIgnore = p.parseWebhookEventFilter(e.key, e.val) |
| 522 | case "workflows": |
| 523 | ret.Workflows = p.parseStringOrStringSequence(e.key.Value, e.val, false, false) |
| 524 | default: |
| 525 | p.unexpectedKey(e.key, name.Value, []string{ |
| 526 | "types", |
| 527 | "branches", |
| 528 | "branches-ignore", |
| 529 | "tags", |
| 530 | "tags-ignore", |
| 531 | "paths", |
| 532 | "paths-ignore", |
| 533 | "workflows", |
| 534 | }) |
| 535 | } |
| 536 | } |
| 537 | |
| 538 | return ret |
| 539 | } |
| 540 | |
| 541 | // https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callinputs |
| 542 | func (p *parser) parseWorkflowCallEventInput(id string, name *String, n *yaml.Node) *WorkflowCallEventInput { |
no test coverage detected