diff options
author | John Olheiser <42128690+jolheiser@users.noreply.github.com> | 2019-11-24 23:17:51 -0600 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-25 13:17:51 +0800 |
commit | 62bcb2b7f1ce1a64f828d94f045d06bd8605455a (patch) | |
tree | 05e9c5c46e08ca787bc08326af6cadb130ded0fd /services | |
parent | 95c3dc856a7d4199232549e3b4d76769ef868bda (diff) | |
download | gitea-62bcb2b7f1ce1a64f828d94f045d06bd8605455a.tar.gz gitea-62bcb2b7f1ce1a64f828d94f045d06bd8605455a.zip |
Add avatar and issue labels to template repositories (#9149)
* Add avatar and issue labels
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix redundant if-err
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'services')
-rw-r--r-- | services/repository/generate.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/services/repository/generate.go b/services/repository/generate.go index bd7fd0ce11..f7e8ebd8c4 100644 --- a/services/repository/generate.go +++ b/services/repository/generate.go @@ -47,6 +47,20 @@ func GenerateRepository(doer, owner *models.User, templateRepo *models.Repositor } } + // Avatar + if opts.Avatar && len(templateRepo.Avatar) > 0 { + if err = models.GenerateAvatar(ctx, templateRepo, generateRepo); err != nil { + return err + } + } + + // Issue Labels + if opts.IssueLabels { + if err = models.GenerateIssueLabels(ctx, templateRepo, generateRepo); err != nil { + return err + } + } + return nil }); err != nil { if generateRepo != nil { |