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

Function looksLikeValidTrigger

pkg/workflow/trigger_parser_fuzz_test.go:366–400  ·  view source on GitHub ↗

looksLikeValidTrigger returns true if the input looks like it might be a valid trigger pattern

(input string)

Source from the content-addressed store, hash-verified

364
365// looksLikeValidTrigger returns true if the input looks like it might be a valid trigger pattern
366func looksLikeValidTrigger(input string) bool {
367 input = strings.TrimSpace(strings.ToLower(input))
368
369 if input == "" {
370 return false
371 }
372
373 // Check for valid pattern prefixes
374 validPrefixes := []string{
375 "push to",
376 "push tags",
377 "pull_request",
378 "pull ",
379 "issue ",
380 "discussion ",
381 "manual",
382 "workflow completed",
383 "comment created",
384 "release ",
385 "repository starred",
386 "repository forked",
387 "dependabot pull request",
388 "security alert",
389 "code scanning alert",
390 "api dispatch",
391 }
392
393 for _, prefix := range validPrefixes {
394 if strings.HasPrefix(input, prefix) {
395 return true
396 }
397 }
398
399 return false
400}

Callers 1

Calls 1

ToLowerMethod · 0.80

Tested by

no test coverage detected