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

Function parseIssueSpec

pkg/cli/trial_helpers.go:242–261  ·  view source on GitHub ↗

parseIssueSpec extracts the issue number from various formats Supports: - GitHub issue URLs: https://github.com/owner/repo/issues/123 - Issue references: #123 - Plain numbers: 123

(input string)

Source from the content-addressed store, hash-verified

240// - Issue references: #123
241// - Plain numbers: 123
242func parseIssueSpec(input string) string {
243 input = strings.TrimSpace(input)
244
245 // First try to match GitHub issue URLs
246 if matches := issueURLPattern.FindStringSubmatch(input); len(matches) >= 2 {
247 return matches[1]
248 }
249
250 // Try to match issue references like #123
251 if matches := issueRefPattern.FindStringSubmatch(input); len(matches) >= 2 {
252 return matches[1]
253 }
254
255 // Try to match plain numbers like 123
256 if issueNumberPattern.MatchString(input) {
257 return input
258 }
259
260 return ""
261}
262
263// saveTrialResult saves a trial result to a JSON file
264func saveTrialResult(filename string, result any, verbose bool) error {

Callers 2

triggerWorkflowRunFunction · 0.85

Calls

no outgoing calls

Tested by 1