Skip to content

Commit 1a9ab86

Browse files
committed
Also consider actions user when evaluating push privileges on protected branch
1 parent 6599efb commit 1a9ab86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/private/hook_pre_receive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func preReceiveBranch(ctx *preReceiveContext, oldCommitID, newCommitID string, r
253253

254254
// 5. Check if the doer is allowed to push (and force-push if the incoming push is a force-push)
255255
var canPush bool
256-
if ctx.opts.DeployKeyID != 0 {
256+
if ctx.opts.DeployKeyID != 0 || ctx.user.ID == user_model.ActionsUserID {
257257
// This flag is only ever true if protectBranch.CanForcePush is true
258258
if isForcePush {
259259
canPush = !changedProtectedfiles && protectBranch.CanPush && (!protectBranch.EnableForcePushAllowlist || protectBranch.ForcePushAllowlistDeployKeys)

0 commit comments

Comments
 (0)