Skip to content

Commit 6639451

Browse files
committed
fix: fix mirror trigger builds auto true
1 parent 1a4ef8b commit 6639451

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mirroring/put.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)