Skip to content

Commit

Permalink
fix: apply sleep before set the default branch
Browse files Browse the repository at this point in the history
  • Loading branch information
beliven-fabrizio-gortani committed Jun 12, 2023
1 parent 579321e commit d8651ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scopes/gitlab/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strconv"
"strings"
"sync"
"time"
)

// The request method perform an HTTP call into gitlab instance using
Expand Down Expand Up @@ -261,6 +262,10 @@ func (g *gitlab) createMirrorProject(name string, path string, groupID int) erro
return err
}

// Sleep because sometimes the repo seems not completed yet.
// and the next call explode!!
time.Sleep(2 * time.Second)

endpoint := fmt.Sprintf("/projects/%d/protected_branches/main", mirrorProject.ID)
payload := map[string]interface{}{
"allow_force_push": true,
Expand Down

0 comments on commit d8651ca

Please sign in to comment.