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

前端 未结 3 1205
一整个雨季
一整个雨季 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.

提交回复
热议问题