@@ -10,14 +10,14 @@ import (
1010 gitlab "gitlab.com/gitlab-org/api/client-go"
1111)
1212
13- func (g * GitlabInstance ) enableProjectMirrorPull (sourceProject * gitlab.Project , destinationProject * gitlab.Project ) error {
13+ func (g * GitlabInstance ) enableProjectMirrorPull (sourceProject * gitlab.Project , destinationProject * gitlab.Project , mirrorOptions * utils. MirroringOptions ) error {
1414 utils .LogVerbosef ("Enabling pull mirror for project %s" , destinationProject .PathWithNamespace )
1515 _ , _ , err := g .Gitlab .Projects .ConfigureProjectPullMirror (destinationProject .ID , & gitlab.ConfigureProjectPullMirrorOptions {
1616 URL : & sourceProject .HTTPURLToRepo ,
1717 OnlyMirrorProtectedBranches : gitlab .Ptr (true ),
1818 Enabled : gitlab .Ptr (true ),
1919 MirrorOverwritesDivergedBranches : gitlab .Ptr (true ),
20- MirrorTriggerBuilds : gitlab .Ptr (true ),
20+ MirrorTriggerBuilds : gitlab .Ptr (mirrorOptions . MirrorTriggerBuilds ),
2121 })
2222 return err
2323}
@@ -81,7 +81,7 @@ func (g *GitlabInstance) updateProjectFromSource(sourceGitlab *GitlabInstance, s
8181 go func () {
8282 defer wg .Done ()
8383 utils .LogVerbosef ("enabling project %s mirror pull" , destinationProject .PathWithNamespace )
84- err := g .enableProjectMirrorPull (sourceProject , destinationProject )
84+ err := g .enableProjectMirrorPull (sourceProject , destinationProject , copyOptions )
8585 if err != nil {
8686 errorChan <- fmt .Errorf ("Failed to enable project mirror pull for %s: %s" , destinationProject .PathWithNamespace , err )
8787 }
0 commit comments