1
0
mirror of synced 2026-02-06 10:55:56 +00:00

Update go-git-providers to v0.19.1

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
This commit is contained in:
Somtochi Onyekwere
2023-10-12 10:26:30 +01:00
parent 39d4270f32
commit 08cb3858ed
3 changed files with 25 additions and 21 deletions

View File

@@ -423,6 +423,11 @@ func (b *GitProviderBootstrapper) reconcileUserRepository(ctx context.Context) (
// branch correctly. Resort to Create until this has been resolved.
repo, err = b.provider.UserRepositories().Create(ctx, repoRef, repoInfo)
if err != nil {
var userErr *gitprovider.ErrIncorrectUser
if errors.As(err, &userErr) {
// return a better error message when the wrong owner is set
err = fmt.Errorf("the specified owner '%s' doesn't match the identity associated with the given token", b.owner)
}
return nil, fmt.Errorf("failed to create new Git repository %q: %w", repoRef.String(), err)
}
b.logger.Successf("repository %q created", repoRef.String())