github API - using curl PUT to add a repo to a team

前端 未结 3 1210
一整个雨季
一整个雨季 2021-02-05 19:34

I am trying to add a repo to a team on github, thus:

curl -i -u username:password  -X PUT  -d "" https://api.github.com/teams/:team/repos/:user/:repo


        
相关标签:
3条回答
  • 2021-02-05 20:25

    "The documents on github prescribe this:"

    Add team repo

    In order to add a repo to a team, the authenticated user must be an owner of the org that the team is associated with.

    PUT /teams/:id/repos/:user/:repo

    Does not work. What does work is this:

    PUT /teams/:id/repos/:org/:repo

    Replacing ":user" with ":org" (the name of the "organization" that the team belongs to.

    0 讨论(0)
  • 2021-02-05 20:25

    For anyone coming across this again... it looks like :org is now the full name and not the ID

    0 讨论(0)
  • 2021-02-05 20:34

    You also need to make sure that the :repo is the repo["name"] field, NOT the repo["id"] field.

    0 讨论(0)
提交回复
热议问题