has_actions field in /admin/users/{owner}/repos is ignored with POST requests (repository creation) #12196

Open
opened 2025-11-02 10:01:41 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @YannMagnin on GitHub (Dec 13, 2023).

Description

When I try to create a repository using POST at /admin/users/{owner}/repos with action, it seems that the field has_actions is completely ignored.

(Note that the following python code snippet uses gitea_api_session_request_data(), which is my wrapper around requests, nothing exotic behind this. This code sample is just to illustrate my point)

data = gitea_api_session_request_data(
    action  = 'post',
    route   = f"/admin/users/{repo_owner_login}/repos",
    data    = {
        'auto_init'         : False,
        'default_branch'    : 'master',
        'description'       : repo_desc,
        'gitignore'         : False,
        'issue_lables'      : None,
        'license'           : None,
        'name'              : repo_name,
        'private'           : repo_is_private,
        'readme'            : None,
        'template'          : False,
        'trust_model'       : 'default',
        'has_actions'       : True, # <-- ignored
        'has_issues'        : True,
        'has_packages'      : False,
        'has_projects'      : True,
        'has_pull_requests' : False,
        'has_releases'      : True,
        'has_wiki'          : False,
    },
)

The workaround I use is to patch the repository just after its creation to force-enable the has_action field

data = gitea_api_session_request_data(
    action  = 'patch',
    route   = f"/repos/{repo.owner}/{repo.name}",
    data    = {
        'has_actions'       : True,
        'has_issues'        : True,
        'has_packages'      : False,
        'has_projects'      : True,
        'has_pull_requests' : False,
        'has_releases'      : True,
        'has_wiki'          : False,
    },
)

Gitea Version

1.21.0, 1.21.1, 1.21.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Linux Mint, EndeavourOS

How are you running Gitea?

Official binaries, and running from systemd and command-line

Database

SQLite

Originally created by @YannMagnin on GitHub (Dec 13, 2023). ### Description When I try to create a repository using `POST` at `/admin/users/{owner}/repos` with action, it seems that the field `has_actions` is completely ignored. (Note that the following python code snippet uses `gitea_api_session_request_data()`, which is my wrapper around `requests`, nothing exotic behind this. This code sample is just to illustrate my point) ```python data = gitea_api_session_request_data( action = 'post', route = f"/admin/users/{repo_owner_login}/repos", data = { 'auto_init' : False, 'default_branch' : 'master', 'description' : repo_desc, 'gitignore' : False, 'issue_lables' : None, 'license' : None, 'name' : repo_name, 'private' : repo_is_private, 'readme' : None, 'template' : False, 'trust_model' : 'default', 'has_actions' : True, # <-- ignored 'has_issues' : True, 'has_packages' : False, 'has_projects' : True, 'has_pull_requests' : False, 'has_releases' : True, 'has_wiki' : False, }, ) ``` The workaround I use is to patch the repository just after its creation to force-enable the `has_action` field ```python data = gitea_api_session_request_data( action = 'patch', route = f"/repos/{repo.owner}/{repo.name}", data = { 'has_actions' : True, 'has_issues' : True, 'has_packages' : False, 'has_projects' : True, 'has_pull_requests' : False, 'has_releases' : True, 'has_wiki' : False, }, ) ``` ### Gitea Version 1.21.0, 1.21.1, 1.21.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Linux Mint, EndeavourOS ### How are you running Gitea? Official binaries, and running from systemd and command-line ### Database SQLite
GiteaMirror added the type/proposalmodifies/api labels 2025-11-02 10:01:41 -06:00
Author
Owner

@lunny commented on GitHub (Dec 14, 2023):

It's not a bug, just not implemented.

@lunny commented on GitHub (Dec 14, 2023): It's not a bug, just not implemented.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12196