1 个不稳定版本
使用旧的Rust 2015
0.1.0 | 2015年9月13日 |
---|
#14 在 #github-issues
16KB
379 行
ghlabel
一个工具,可以自动在GitHub Issues上创建和删除标签以匹配YAML模板。
当你在GitHub上创建一个新的仓库时,问题跟踪器中的默认标签对于基本使用来说已经足够好了。有时你更喜欢以不同的方式组织标签,并希望每个项目都使用自己的标签。如果你有大量的仓库和/或标签,通过网页界面手动执行这个过程可能会非常痛苦。ghlabel通过运行一个命令将仓库的标签设置为YAML模板中定义的标签,从而帮助你节省时间。
安装
Mac OS X和Linux的二进制发布版可在发布页面上获取。
用法
ghlabel [FLAGS] --file <file> --token <token> --user <user> --repo <repo>
FLAGS:
-d, --dry-run Print what the program would do without actually doing it
-h, --help Prints help information
--no-create Do not create labels missing from the repo but present in the file
--no-delete Do not delete labels in the repo that are not in the file
-v, --version Prints version information
OPTIONS:
-f, --file <file> Path to a YAML file containing the label template
-r, --repo <repo> The name of the repository to apply the label template to
-t, --token <token> OAuth token for authenticating with GitHub
-u, --user <user> The name of the user or organization that owns the repository
示例
ghlabel --file labels.yml --token abc123 --user rust-lang --repo rust
该文件必须包含一个哈希数组,每个哈希都有一个名称和颜色。例如,以下是一个GitHub Issues默认标签子集的模板
- name: bug
color: fc2929
- name: duplicate
color: cccccc
- name: enhancement
color: 84b6eb
默认情况下,如果文件中不存在,将创建(或更新,如果颜色已更改)GitHub上的每个标签,并将GitHub上的每个不在文件中的标签删除。使用--no-create和--no-delete标志分别限制此行为。程序没有输出表示没有进行更改。
可以从https://github.com/settings/tokens获取OAuth令牌。如果程序将在私有仓库上运行,则使用的令牌需要“repo”权限。否则,它只需要“public_repo”权限。
示例
此仓库中的labels.yml
文件被用作在GitHub Issues中创建标签的模板。
许可证
依赖项
~6MB
~113K SLoC