From d257485bc0026c9717fe7bf4c9953ad1b7a1a9ae Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 30 Aug 2020 08:24:39 +0100 Subject: Rename models.ProtectedBranchRepoID to models.EnvRepoID and ensure EnvPusherEmail is set (#12646) Signed-off-by: Andrew Thornton --- cmd/hook.go | 2 +- cmd/serv.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/hook.go b/cmd/hook.go index 863ed832a9..cc5289db6e 100644 --- a/cmd/hook.go +++ b/cmd/hook.go @@ -170,7 +170,7 @@ Gitea or set your environment appropriately.`, "") username := os.Getenv(models.EnvRepoUsername) reponame := os.Getenv(models.EnvRepoName) userID, _ := strconv.ParseInt(os.Getenv(models.EnvPusherID), 10, 64) - prID, _ := strconv.ParseInt(os.Getenv(models.ProtectedBranchPRID), 10, 64) + prID, _ := strconv.ParseInt(os.Getenv(models.EnvPRID), 10, 64) isDeployKey, _ := strconv.ParseBool(os.Getenv(models.EnvIsDeployKey)) hookOptions := private.HookOptions{ diff --git a/cmd/serv.go b/cmd/serv.go index cccf3de074..f260685400 100644 --- a/cmd/serv.go +++ b/cmd/serv.go @@ -206,9 +206,10 @@ func runServ(c *cli.Context) error { os.Setenv(models.EnvRepoName, results.RepoName) os.Setenv(models.EnvRepoUsername, results.OwnerName) os.Setenv(models.EnvPusherName, results.UserName) + os.Setenv(models.EnvPusherEmail, results.UserEmail) os.Setenv(models.EnvPusherID, strconv.FormatInt(results.UserID, 10)) - os.Setenv(models.ProtectedBranchRepoID, strconv.FormatInt(results.RepoID, 10)) - os.Setenv(models.ProtectedBranchPRID, fmt.Sprintf("%d", 0)) + os.Setenv(models.EnvRepoID, strconv.FormatInt(results.RepoID, 10)) + os.Setenv(models.EnvPRID, fmt.Sprintf("%d", 0)) os.Setenv(models.EnvIsDeployKey, fmt.Sprintf("%t", results.IsDeployKey)) os.Setenv(models.EnvKeyID, fmt.Sprintf("%d", results.KeyID)) -- cgit v1.2.3