Skip to content

api does not change repository properties #15121

Closed
@philfry

Description

@philfry

Description

trying to update some repository's attributes like disabling the issue tracker, pull requests, the wiki, converting it to private, doesn't have any effect.

Screenshots

gitea

#!/bin/bash
token="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
apiurl="https://try.gitea.io/api/v1"
fullname="philfry/testrepository"

status() {
    curl -s \
        -H "Accept: application/json" -H "Authorization: token ${token}" \
        "${apiurl}/repos/${fullname}" | jq '.|{has_issues,has_projects,has_wiki,private}'
}

setval() {
    echo "set $1 to $2"
    curl -s -X PATCH \
        -H "Accept: application/json" -H "Authorization: token ${token}" \
        "${apiurl}/repos/${fullname}" -d "{\"$1\":$2}" | jq .${1}
}

status
setval has_issues false
setval has_projects false
setval has_wiki false
setval private true
status

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/not-a-bugThe reported issue is the intended behavior or the problem is not inside Gitea

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions