mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-17 11:06:32 +02:00
skip nested GitLab repositories during sync (#656)
Implements https://github.com/woodpecker-ci/woodpecker/pull/651#issuecomment-1003794674, partly fixes #648
This commit is contained in:
parent
7e6765ce95
commit
132d3567f4
@ -24,6 +24,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/xanzy/go-gitlab"
|
"github.com/xanzy/go-gitlab"
|
||||||
|
|
||||||
"github.com/woodpecker-ci/woodpecker/server"
|
"github.com/woodpecker-ci/woodpecker/server"
|
||||||
@ -249,6 +250,13 @@ func (g *Gitlab) Repos(ctx context.Context, user *model.User) ([]*model.Repo, er
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(648) remove when woodpecker understands nested repos
|
||||||
|
if strings.Count(repo.FullName, "/") > 1 {
|
||||||
|
log.Debug().Msgf("Skipping nested repository %s for user %s, because they are not supported, yet (see #648).", repo.FullName, user.Login)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
repos = append(repos, repo)
|
repos = append(repos, repo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user