// Execute executes the executionPlan in either one or two phases.
// Dual phase mode is designed to retrieve Github's mergability status in two phases when this action is triggered on
// merge to a base branch. Because immediately following a merge, Github cannot yet determine the mergability of pull
// requests, the first phase is a request to Github to update its mergability statuses.
//
// The second phase is to determine the actual mergability of all open pull requests.
Execute executes the executionPlan in either one or two phases.
Dual phase mode is designed to retrieve Github's mergability status in two phases when this action is triggered on
merge to a base branch. Because immediately following a merge, Github cannot yet determine the mergability of pull
requests, the first phase is a request to Github to update its mergability statuses.

The second phase is to determine the actual mergability of all open pull requests.
// Execute executes the executionPlan in either one or two phases . // Dual phase mode is designed to retrieve Github ' s mergability status in two phases when this action is triggered on // merge to a base branch . Because immediately following a merge Github cannot yet determine the mergability of pull // requests the first phase is a request to Github to update its mergability statuses . // // The second phase is to determine the actual mergability of all open pull requests .
func (e *executor) Execute() error {
	if config.SettingEnabled(config.DualPass) {
		timer := e.executionPlan.DualPassTimer()
		ListPulls(e.executionPlan.client())
		done := false
		tick := time.Tick(1 * time.Second)
		countdown := time.Now().Add(dualPassInterval())
		for !done {
			select {
			case <-tick:
				s := math.Round(countdown.Sub(time.Now()).Seconds())
				log.Println("Waiting ...", s, "seconds")
			case <-timer.C:
				log.Println("Phase 1 complete.")
				done = true
			}
		}
	} else {
		log.Println("Single pass mode")
	}
	return e.executionPlan.Execute()
}
func ( e * executor ) Execute ( ) error { if config . SettingEnabled ( config . DualPass ) { timer := e . executionPlan . DualPassTimer ( ) ListPulls ( e . executionPlan . client ( ) ) done := false tick := time . Tick ( 1 * time . Second ) countdown := time . Now ( ) . Add ( dualPassInterval ( ) ) for ! done { select { case <- tick : s := math . Round ( countdown . Sub ( time . Now ( ) ) . Seconds ( ) ) log . Println ( " " , s , " " ) case <- timer . C : log . Println ( " " ) done = true } } } else { log . Println ( " " ) } return e . executionPlan . Execute ( ) }
Execute executes the executionPlan in either one or two phases.
Execute executes the executionPlan in either one or two phases .
// List open pull requests to trigger a refresh of Github's mergability status