Skip to content

Commit 301a9ca

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

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

options/locale/locale_en-US.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,12 +2490,12 @@ settings.protect_enable_merge = Enable Merge
24902490
settings.protect_enable_merge_desc = Anyone with write access will be allowed to merge the pull requests into this branch.
24912491
settings.protect_whitelist_committers = Allowlist Restricted Push
24922492
settings.protect_whitelist_committers_desc = Only allowlisted users or teams will be allowed to push to this branch (but not force push).
2493-
settings.protect_whitelist_deploy_keys = Allowlist deploy keys with write access to push.
2493+
settings.protect_whitelist_deploy_keys = Allowlist actions & deploy keys with write access to push.
24942494
settings.protect_whitelist_users = Allowlisted users for pushing:
24952495
settings.protect_whitelist_teams = Allowlisted teams for pushing:
24962496
settings.protect_force_push_allowlist_users = Allowlisted users for force pushing:
24972497
settings.protect_force_push_allowlist_teams = Allowlisted teams for force pushing:
2498-
settings.protect_force_push_allowlist_deploy_keys = Allowlist deploy keys with push access to force push.
2498+
settings.protect_force_push_allowlist_deploy_keys = Allowlist actions & deploy keys with push access to force push.
24992499
settings.protect_merge_whitelist_committers = Enable Merge Allowlist
25002500
settings.protect_merge_whitelist_committers_desc = Allow only allowlisted users or teams to merge pull requests into this branch.
25012501
settings.protect_merge_whitelist_users = Allowlisted users for merging:

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)