0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-19 02:00:58 +02:00

Merge 1a9ab86a15868e9db0f179bef35c2f3518ebb91d into 6599efb3b1400ac06d06e1c8b68ae6037fbb7952

This commit is contained in:
Naxdy 2025-07-12 11:29:46 +02:00 committed by GitHub
commit b52babb52d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -253,7 +253,7 @@ func preReceiveBranch(ctx *preReceiveContext, oldCommitID, newCommitID string, r
// 5. Check if the doer is allowed to push (and force-push if the incoming push is a force-push) // 5. Check if the doer is allowed to push (and force-push if the incoming push is a force-push)
var canPush bool var canPush bool
if ctx.opts.DeployKeyID != 0 { if ctx.opts.DeployKeyID != 0 || ctx.user.ID == user_model.ActionsUserID {
// This flag is only ever true if protectBranch.CanForcePush is true // This flag is only ever true if protectBranch.CanForcePush is true
if isForcePush { if isForcePush {
canPush = !changedProtectedfiles && protectBranch.CanPush && (!protectBranch.EnableForcePushAllowlist || protectBranch.ForcePushAllowlistDeployKeys) canPush = !changedProtectedfiles && protectBranch.CanPush && (!protectBranch.EnableForcePushAllowlist || protectBranch.ForcePushAllowlistDeployKeys)