|
|
@ -14,12 +14,14 @@ import ( |
|
|
|
const ( |
|
|
|
const ( |
|
|
|
EnvRepoName = "GITEA_REPO_NAME" |
|
|
|
EnvRepoName = "GITEA_REPO_NAME" |
|
|
|
EnvRepoUsername = "GITEA_REPO_USER_NAME" |
|
|
|
EnvRepoUsername = "GITEA_REPO_USER_NAME" |
|
|
|
|
|
|
|
EnvRepoID = "GITEA_REPO_ID" |
|
|
|
EnvRepoIsWiki = "GITEA_REPO_IS_WIKI" |
|
|
|
EnvRepoIsWiki = "GITEA_REPO_IS_WIKI" |
|
|
|
EnvPusherName = "GITEA_PUSHER_NAME" |
|
|
|
EnvPusherName = "GITEA_PUSHER_NAME" |
|
|
|
EnvPusherEmail = "GITEA_PUSHER_EMAIL" |
|
|
|
EnvPusherEmail = "GITEA_PUSHER_EMAIL" |
|
|
|
EnvPusherID = "GITEA_PUSHER_ID" |
|
|
|
EnvPusherID = "GITEA_PUSHER_ID" |
|
|
|
EnvKeyID = "GITEA_KEY_ID" |
|
|
|
EnvKeyID = "GITEA_KEY_ID" |
|
|
|
EnvIsDeployKey = "GITEA_IS_DEPLOY_KEY" |
|
|
|
EnvIsDeployKey = "GITEA_IS_DEPLOY_KEY" |
|
|
|
|
|
|
|
EnvPRID = "GITEA_PR_ID" |
|
|
|
EnvIsInternal = "GITEA_INTERNAL_PUSH" |
|
|
|
EnvIsInternal = "GITEA_INTERNAL_PUSH" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -48,9 +50,7 @@ func FullPushingEnvironment(author, committer *User, repo *Repository, repoName |
|
|
|
authorSig := author.NewGitSig() |
|
|
|
authorSig := author.NewGitSig() |
|
|
|
committerSig := committer.NewGitSig() |
|
|
|
committerSig := committer.NewGitSig() |
|
|
|
|
|
|
|
|
|
|
|
// We should add "SSH_ORIGINAL_COMMAND=gitea-internal",
|
|
|
|
environ := append(os.Environ(), |
|
|
|
// once we have hook and pushing infrastructure working correctly
|
|
|
|
|
|
|
|
return append(os.Environ(), |
|
|
|
|
|
|
|
"GIT_AUTHOR_NAME="+authorSig.Name, |
|
|
|
"GIT_AUTHOR_NAME="+authorSig.Name, |
|
|
|
"GIT_AUTHOR_EMAIL="+authorSig.Email, |
|
|
|
"GIT_AUTHOR_EMAIL="+authorSig.Email, |
|
|
|
"GIT_COMMITTER_NAME="+committerSig.Name, |
|
|
|
"GIT_COMMITTER_NAME="+committerSig.Name, |
|
|
@ -60,9 +60,15 @@ func FullPushingEnvironment(author, committer *User, repo *Repository, repoName |
|
|
|
EnvRepoIsWiki+"="+isWiki, |
|
|
|
EnvRepoIsWiki+"="+isWiki, |
|
|
|
EnvPusherName+"="+committer.Name, |
|
|
|
EnvPusherName+"="+committer.Name, |
|
|
|
EnvPusherID+"="+fmt.Sprintf("%d", committer.ID), |
|
|
|
EnvPusherID+"="+fmt.Sprintf("%d", committer.ID), |
|
|
|
ProtectedBranchRepoID+"="+fmt.Sprintf("%d", repo.ID), |
|
|
|
EnvRepoID+"="+fmt.Sprintf("%d", repo.ID), |
|
|
|
ProtectedBranchPRID+"="+fmt.Sprintf("%d", prID), |
|
|
|
EnvPRID+"="+fmt.Sprintf("%d", prID), |
|
|
|
"SSH_ORIGINAL_COMMAND=gitea-internal", |
|
|
|
"SSH_ORIGINAL_COMMAND=gitea-internal", |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !committer.KeepEmailPrivate { |
|
|
|
|
|
|
|
environ = append(environ, EnvPusherEmail+"="+committer.Email) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return environ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|