aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/serv.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-03-22 17:29:07 +0800
committerGitHub <noreply@github.com>2022-03-22 17:29:07 +0800
commit2b55422cd71b0b325f054646de5cebf39b72b502 (patch)
tree27e71f4e6e27fd5bbb2c13a27e572ef0b41a1e6d /cmd/serv.go
parent80fd25524e13dedbdc3527b32d008de152213a89 (diff)
downloadgitea-2b55422cd71b0b325f054646de5cebf39b72b502.tar.gz
gitea-2b55422cd71b0b325f054646de5cebf39b72b502.zip
Fix the bug: deploy key with write access can not push (#19010)
Use DeployKeyID to replace the IsDeployKey, then CanWriteCode uses the DeployKeyID to check the write permission.
Diffstat (limited to 'cmd/serv.go')
-rw-r--r--cmd/serv.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/serv.go b/cmd/serv.go
index b4ef37f1dc..c834ca298a 100644
--- a/cmd/serv.go
+++ b/cmd/serv.go
@@ -243,7 +243,7 @@ func runServ(c *cli.Context) error {
os.Setenv(models.EnvPusherID, strconv.FormatInt(results.UserID, 10))
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.EnvDeployKeyID, fmt.Sprintf("%d", results.DeployKeyID))
os.Setenv(models.EnvKeyID, fmt.Sprintf("%d", results.KeyID))
os.Setenv(models.EnvAppURL, setting.AppURL)