Skip to content

Commit

Permalink
env var GITEA_PUSHER_EMAIL (#4516)
Browse files Browse the repository at this point in the history
* env var GITEA_PUSHER_EMAIL

* set pusher email only if email address is not private
  • Loading branch information
treyerl authored and lafriks committed Jul 26, 2018
1 parent a847d16 commit be4ec0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions models/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
EnvRepoUsername = "GITEA_REPO_USER_NAME"
EnvRepoIsWiki = "GITEA_REPO_IS_WIKI"
EnvPusherName = "GITEA_PUSHER_NAME"
EnvPusherEmail = "GITEA_PUSHER_EMAIL"
EnvPusherID = "GITEA_PUSHER_ID"
)

Expand Down
5 changes: 5 additions & 0 deletions routers/repo/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ func HTTP(ctx *context.Context) {
models.EnvPusherID + fmt.Sprintf("=%d", authUser.ID),
models.ProtectedBranchRepoID + fmt.Sprintf("=%d", repo.ID),
}

if !authUser.KeepEmailPrivate {
environ = append(environ, models.EnvPusherEmail+"="+authUser.Email)
}

if isWiki {
environ = append(environ, models.EnvRepoIsWiki+"=true")
} else {
Expand Down

0 comments on commit be4ec0c

Please sign in to comment.