Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create branch protection api doesn't honor enable_force_push or enable_force_push_allowlist #33682

Open
lissom opened this issue Feb 21, 2025 · 0 comments
Labels
topic/api Concerns mainly the API type/bug

Comments

@lissom
Copy link

lissom commented Feb 21, 2025

Description

        data = {
            "rule_name": "master,release/**",
            "enable_force_push": True,
            "enable_force_push_allowlist": True,
            "force_push_allowlist_teams": ["General"],
            "required_approvals": 1,
            "priority": 10,
        }
        url = f"{GITEA_API_URL}/api/v1/repos/{org_name}/{repo_name}/branch_protections"
        response = requests.post(url, headers=HEADERS, data=json.dumps(data))

Looking at the repo in the UI or with a GET call, enable_force_push is completely disabled.

Using the UI, this works.

Gitea Version

1.23.4

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

2.40.1

Operating System

Linux

How are you running Gitea?

Downloaded gitea from the github link.

Database

None

@kemzeb kemzeb added the topic/api Concerns mainly the API label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/api Concerns mainly the API type/bug
Projects
None yet
Development

No branches or pull requests

2 participants