Skip to content

API ignores branch protection rule for "enable_force_push_allowlist" upon creation #35121

@HenrijsT

Description

@HenrijsT

Description

Cannot set "enable_force_push_allowlist" to true when creating branch protection rule using Gitea API
Setting this rule using PATCH works correctly.

Tried multiple different settings:

  • With whitelist teams / users set
  • With and without enable_push parameter being false and true
  • With other whitelist settings

Could not access Gitea demo site - so was not able to reproduce the bug there.

Reproduction steps:
call POST /repos/{owner}/{repo}/branch_protections

Set parameters:
"branch_name": "random",
"enable_force_push_allowlist": true

Payload and Gitea response example :
force-push-allowlist.log

Gitea Version

1.23.5

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?

Our gitea is running in Docker, following your official example :
https://docs.gitea.com/installation/install-with-docker

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions