GitLab Manager
This skill allows interaction with GitLab.com via the API.
Prerequisites
- - GITLAB_TOKEN: A Personal Access Token with
api scope must be set in the environment.
Usage
Use the provided Node.js script to interact with GitLab.
Script Location
INLINECODE1
Commands
1. Create Repository
Create a new project in GitLab.
CODEBLOCK0
2. List Merge Requests
List MRs for a specific project.
CODEBLOCK1
3. Comment on Merge Request
Add a comment (note) to a specific MR. Useful for code review.
CODEBLOCK2
4. Create Issue
Open a new issue.
CODEBLOCK3
Examples
Create a private repo:
CODEBLOCK4
Review an MR:
CODEBLOCK5
GitLab 管理器
该技能允许通过API与GitLab.com进行交互。
前置条件
- - GITLAB_TOKEN:需在环境中设置一个具有api权限的个人访问令牌。
使用方法
使用提供的Node.js脚本与GitLab进行交互。
脚本位置
scripts/gitlab_api.js
命令
1. 创建仓库
在GitLab中创建一个新项目。
bash
./scripts/gitlab
api.js createrepo <名称> <描述> <可见性>
可见性:private(默认)、public、internal
2. 列出合并请求
列出指定项目的MR。
bash
./scripts/gitlab
api.js listmrs <项目路径> [状态]
项目路径:例如 jorgermp/my-repo(将自动进行URL编码)
状态:opened(默认)、closed、merged、all
3. 评论合并请求
向指定MR添加评论(备注)。适用于代码审查。
bash
./scripts/gitlab
api.js commentmr <项目路径>
<评论内容>
4. 创建问题
创建一个新问题。
bash
./scripts/gitlabapi.js createissue <项目路径> <标题> <描述>
示例
创建私有仓库:
bash
GITLABTOKEN=... ./scripts/gitlabapi.js create_repo new-tool 一个很酷的新工具 private
审查MR:
bash
先列出以查找ID
GITLABTOKEN=... ./scripts/gitlabapi.js list_mrs jorgermp/my-tool opened
然后评论
GITLABTOKEN=... ./scripts/gitlabapi.js comment_mr jorgermp/my-tool 1 工作做得很好,但请检查缩进。