Skip to content

Commit be4ec0c

Browse files
treyerllafriks
authored andcommitted
env var GITEA_PUSHER_EMAIL (#4516)
* env var GITEA_PUSHER_EMAIL * set pusher email only if email address is not private
1 parent a847d16 commit be4ec0c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

models/update.go

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const (
2323
EnvRepoUsername = "GITEA_REPO_USER_NAME"
2424
EnvRepoIsWiki = "GITEA_REPO_IS_WIKI"
2525
EnvPusherName = "GITEA_PUSHER_NAME"
26+
EnvPusherEmail = "GITEA_PUSHER_EMAIL"
2627
EnvPusherID = "GITEA_PUSHER_ID"
2728
)
2829

routers/repo/http.go

+5
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ func HTTP(ctx *context.Context) {
226226
models.EnvPusherID + fmt.Sprintf("=%d", authUser.ID),
227227
models.ProtectedBranchRepoID + fmt.Sprintf("=%d", repo.ID),
228228
}
229+
230+
if !authUser.KeepEmailPrivate {
231+
environ = append(environ, models.EnvPusherEmail+"="+authUser.Email)
232+
}
233+
229234
if isWiki {
230235
environ = append(environ, models.EnvRepoIsWiki+"=true")
231236
} else {

0 commit comments

Comments
 (0)