MCPcopy Create free account
hub / github.com/cli/cli / waitForWorkflowRun

Function waitForWorkflowRun

acceptance/acceptance_test.go:55–69  ·  view source on GitHub ↗
(list func() (string, error), sleep func(time.Duration))

Source from the content-addressed store, hash-verified

53var errWorkflowRunRegistrationTimeout = errors.New("workflow run did not register within 60 seconds")
54
55func waitForWorkflowRun(list func() (string, error), sleep func(time.Duration)) (string, error) {
56 for attempt := 0; attempt < workflowPollAttempts; attempt++ {
57 runID, err := list()
58 if err != nil {
59 return "", err
60 }
61 if runID != "" {
62 return runID, nil
63 }
64 if attempt < workflowPollAttempts-1 {
65 sleep(workflowPollInterval)
66 }
67 }
68 return "", errWorkflowRunRegistrationTimeout
69}
70
71func workflowRunIDFromOutput(output string) string {
72 runURL, err := url.ParseRequestURI(strings.TrimSpace(output))

Callers 2

resolveWorkflowRunIDFunction · 0.85
TestWaitForWorkflowRunFunction · 0.85

Calls 1

sleepFunction · 0.85

Tested by

no test coverage detected