diff --git a/pkg/plugins/scms/githubsearch/spec.go b/pkg/plugins/scms/githubsearch/spec.go index 0dd369e094..8f52a7d03b 100644 --- a/pkg/plugins/scms/githubsearch/spec.go +++ b/pkg/plugins/scms/githubsearch/spec.go @@ -10,6 +10,15 @@ import ( // Spec represents the configuration input type Spec struct { + // Depth defines the depth used when cloning the git repository. + // + // Default: disabled (full clone) + // + // Remark: + // When using a shallow clone (depth greater than 0), Updatecli is not able to retrieve the full git history. + // This may cause some issues when Updatecli tries to push changes to the remote repository. + // In that case, you may need to set the force option to true to force push changes to the remote repository. + Depth *int `yaml:",omitempty"` // Limit defines the maximum number of repositories to return from the search query. // // compatible: diff --git a/pkg/plugins/scms/githubsearch/specGenerator.go b/pkg/plugins/scms/githubsearch/specGenerator.go index 7f35ddf2ea..51a6b7c262 100644 --- a/pkg/plugins/scms/githubsearch/specGenerator.go +++ b/pkg/plugins/scms/githubsearch/specGenerator.go @@ -43,6 +43,7 @@ func (g GitHubSearch) ScmsGenerator(ctx context.Context) (results []github.Spec, CommitMessage: g.spec.CommitMessage, CommitUsingAPI: g.spec.CommitUsingAPI, Directory: g.spec.Directory, + Depth: g.spec.Depth, Email: g.spec.Email, Force: g.spec.Force, GPG: g.spec.GPG,