如何通过APIcurl向gitlab中的项目添加组?

问题描述 投票:0回答:2

我的 Gitlab 中有很多项目,我想向我的所有项目添加一个组。

我正在寻找一个curl命令来邀请一个小组加入我的Gitlab项目。

例如维护者权限

gitlab gitlab-api
2个回答
2
投票
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.com/api/v4/groups/:id/projects/:project_id"

请参阅 Gitlab 文档了解更多详细信息

https://docs.gitlab.com/ee/api/groups.html


0
投票

以下内容实际上对我有用

curl -X POST --header "PRIVATE-TOKEN: xxxxxxxxxxxx" --header "Content-Type: application/json" "https://gitlab.com/api/v4/projects/<<project_id>>/share" --data '{"group_id":<<group_id>>,"group_access":<<access to given to group>>}'

其中 group_id 是您要添加为项目成员的组的组 ID

© www.soinside.com 2019 - 2024. All rights reserved.