Skip to content

Force Push Allowlist users can't be updated by API #35893

@zorrobiwan

Description

@zorrobiwan

Description

On branch protection creation (POST) or update (PATCH), setting force_push_allowlist_usernames has no effect.

How to reproduce

  • choose a repository
  • create a default branch protection on master
  • call /api/v1/repos///branch_protections/master (PATCH) with the following payload
{ "enable_force_push": true, "enable_force_push_allowlist" : true, "force_push_allowlist_usernames" : ["<user>"] } 

Workaround
Use the following payload

{ "enable_force_push": true, "enable_force_push_allowlist" : true, "force_push_allowlist_usernames" : ["<user>"], "force_push_allowlist_deploy_keys" : true } 

Gitea Version

1.24.6

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

On premise

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions