Skip to content

Commit

Permalink
chore: add PATH and HOME to cmds (#1436)
Browse files Browse the repository at this point in the history
  • Loading branch information
codyoss committed Feb 10, 2022
1 parent 81492cc commit 50051fb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions internal/kokoro/discogen/main.go
Expand Up @@ -83,11 +83,23 @@ func setGitCreds(githubName, githubEmail, githubUsername, accessToken string) er
return err
}
c := exec.Command("git", "config", "--global", "user.name", githubName)
c.Env = []string{
fmt.Sprintf("PATH=%s", os.Getenv("PATH")),
fmt.Sprintf("HOME=%s", os.Getenv("HOME")),
}
c.Stdout = os.Stdout
c.Stderr = os.Stderr
if err := c.Run(); err != nil {
return err
}

c = exec.Command("git", "config", "--global", "user.email", githubEmail)
c.Env = []string{
fmt.Sprintf("PATH=%s", os.Getenv("PATH")),
fmt.Sprintf("HOME=%s", os.Getenv("HOME")),
}
c.Stdout = os.Stdout
c.Stderr = os.Stderr
return c.Run()
}

Expand Down Expand Up @@ -155,6 +167,8 @@ func makePR(ctx context.Context, accessToken, dir string) error {
c.Env = []string{
fmt.Sprintf("COMMIT_TITLE=%s", commitTitle),
fmt.Sprintf("BRANCH_NAME=%s", branchName),
fmt.Sprintf("PATH=%s", os.Getenv("PATH")),
fmt.Sprintf("HOME=%s", os.Getenv("HOME")),
}
c.Dir = dir
c.Stderr = os.Stderr
Expand Down

0 comments on commit 50051fb

Please sign in to comment.