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

Function waitForWorkflowRunStatus

acceptance/acceptance_test.go:200–217  ·  view source on GitHub ↗
(view func() (string, error), expected string, sleep func(time.Duration))

Source from the content-addressed store, hash-verified

198}
199
200func waitForWorkflowRunStatus(view func() (string, error), expected string, sleep func(time.Duration)) error {
201 for attempt := 0; attempt < workflowRunStatusPollAttempts; attempt++ {
202 status, err := view()
203 if err != nil {
204 return err
205 }
206 if status == expected {
207 return nil
208 }
209 if status == "completed" {
210 return fmt.Errorf("workflow run completed before reaching status %q", expected)
211 }
212 if attempt < workflowRunStatusPollAttempts-1 {
213 sleep(workflowRunStatusPollInterval)
214 }
215 }
216 return fmt.Errorf("workflow run did not reach status %q within 60 seconds", expected)
217}
218
219func outputForEnvironment(output string) (string, error) {
220 if strings.TrimSpace(output) == "" {

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected