diff --git a/scopes/gitlab/main.go b/scopes/gitlab/main.go index 6235f11..6a1e4c5 100644 --- a/scopes/gitlab/main.go +++ b/scopes/gitlab/main.go @@ -11,6 +11,7 @@ import ( "strconv" "strings" "sync" + "time" ) // The request method perform an HTTP call into gitlab instance using @@ -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,