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

Function parseSourceControlTrigger

pkg/workflow/trigger_parser.go:172–188  ·  view source on GitHub ↗

parseSourceControlTrigger parses source control triggers

(input string)

Source from the content-addressed store, hash-verified

170
171// parseSourceControlTrigger parses source control triggers
172func parseSourceControlTrigger(input string) (*TriggerIR, error) {
173 tokens := strings.Fields(input)
174 if len(tokens) == 0 {
175 return nil, nil
176 }
177
178 switch tokens[0] {
179 case "push":
180 return parsePushTrigger(tokens)
181 case "pull", "pull_request":
182 // Normalize "pull" to "pull_request"
183 normalizedTokens := append([]string{"pull_request"}, tokens[1:]...)
184 return parsePullRequestTrigger(normalizedTokens)
185 default:
186 return nil, nil
187 }
188}
189
190// parsePushTrigger parses push-related triggers
191func parsePushTrigger(tokens []string) (*TriggerIR, error) {

Callers 1

ParseTriggerShorthandFunction · 0.85

Calls 2

parsePushTriggerFunction · 0.85
parsePullRequestTriggerFunction · 0.85

Tested by

no test coverage detected