Gitlab Manager技能使用说明

subsun 5个月前 (03-29) openclaw小龙虾 208 0

GitLab 管理器

此技能允许通过 API 与 GitLab.com 进行交互。

前提条件

  • GITLAB_TOKEN:一个具有api范围的个人访问令牌必须设置在环境变量中。

使用方法

使用提供的 Node.js 脚本与 GitLab 交互。

Gitlab Manager

脚本位置

scripts/gitlab_api.js

命令

1. 创建仓库

在 GitLab 中创建一个新项目。

./scripts/gitlab_api.js create_repo "<name>" "<description>" "<visibility>"
# Visibility: private (default), public, internal

2. 列出合并请求

列出特定项目的合并请求。

./scripts/gitlab_api.js list_mrs "<project_path>" "[state]"
# Project path: e.g., "jorgermp/my-repo" (will be URL encoded automatically)
# State: opened (default), closed, merged, all

3. 评论合并请求

向特定的合并请求添加评论(备注)。适用于代码审查。

./scripts/gitlab_api.js comment_mr "<project_path>" <mr_iid> "<comment_body>"

4. 创建议题

开启一个新议题。

./scripts/gitlab_api.js create_issue "<project_path>" "<title>" "<description>"

示例

创建一个私有仓库:

GITLAB_TOKEN=... ./scripts/gitlab_api.js create_repo "new-tool" "A cool new tool" "private"

审查一个合并请求:

# First list to find ID
GITLAB_TOKEN=... ./scripts/gitlab_api.js list_mrs "jorgermp/my-tool" "opened"
# Then comment
GITLAB_TOKEN=... ./scripts/gitlab_api.js comment_mr "jorgermp/my-tool" 1 "Great work, but check indentation."

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏

相关推荐

网友评论

  • (*)

最新评论

用户管理

您好,欢迎到访网站!
    用户注册

您是本站第1624399名访客 今日有0篇新文章/评论