Skip to content

Commit 60a308c

Browse files
Merge pull request #387 from ankitm123/ignore-root-gituser
fix: ignore root git user
2 parents 3686435 + c3dfe10 commit 60a308c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.jx/updatebot.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ spec:
1717
- jx-pipeline
1818
- jx-admin
1919
- jx-preview
20+
- jx-updatebot
2021
package: github.com/jenkins-x/jx-helpers
2122
upgradePackages:
2223
include:

pkg/gitclient/setup.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ import (
1313
"github.com/pkg/errors"
1414
)
1515

16-
var (
17-
info = termcolor.ColorInfo
18-
)
16+
var info = termcolor.ColorInfo
1917

2018
// EnsureUserAndEmailSetup returns the user name and email for the gitter
2119
// lazily setting them if they are blank either from the given values or if they are empty
2220
// using environment variables `GIT_AUTHOR_NAME` and `GIT_AUTHOR_EMAIL` or using default values
2321
func EnsureUserAndEmailSetup(gitter Interface, dir string, gitUserName string, gitUserEmail string) (string, string, error) {
2422
userName, _ := gitter.Command(dir, "config", "--get", "user.name")
2523
userEmail, _ := gitter.Command(dir, "config", "--get", "user.email")
26-
if userName == "" {
24+
// Seems like changing it to alpine image, results in username being set to root
25+
// ToDo(@ankitm123): Look at why this happened in alpine go image and not the normal go image
26+
if userName == "" || userName == "root" {
2727
userName = gitUserName
2828
if userName == "" {
2929
userName = os.Getenv("GIT_AUTHOR_NAME")

0 commit comments

Comments
 (0)