网淘吧来吧,欢迎您!

Gitlab Manager技能使用说明

2026-03-29 新闻来源:网淘吧 围观:25
电脑广告
手机广告

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."

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部

相关文章

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