管理github问题标签的python 3.6cli应用程序
labels的Python项目详细描述
标签
管理github问题标签的python 3.6 cli应用程序
安装
下载$ pip install labels
身份验证
labels cli连接到github api以修改github的问题标签 储存库。请create your own personal API token和 根据是否要管理问题选择正确的令牌作用域 公共或私有存储库的标签。然后建立两个环境 终端中的变量:
$ exportLABELS_USERNAME="<GITHUB_USERNAME>" $ exportLABELS_TOKEN="<GITHUB_TOKEN>"
用法
一旦安装了labels并设置了环境变量,就可以
准备使用labelscli来管理github的问题标签
储存库。cli附带两个命令:fetch
和sync
。
两者都要求您指定github存储库的所有者和名称 使用cli选项:
-o, --owner TEXT GitHub owner name -r, --repo TEXT GitHub repository name
获取
当您第一次使用labels时,您需要获取
关于您的项目的现有标签的信息。cli将
然后用检索到的
信息。此文件的默认文件名是
当前工作目录,可以通过传递
-f, --filename PATH
选项后跟路径。
$ labels fetch -o hackebrot -r pytest-emoji
[bug]color="ea707a"description="Bugs and problems with pytest-emoji"name="bug"["code quality"]color="fcc4db"description="Tasks related to linting, coding style, type checks"name="code quality"[dependencies]color="43a2b7"description="Tasks related to managing dependencies"name="dependencies"[docs]color="2abf88"description="Tasks to write and update documentation"name="docs"["good first issue"]color="bfdadc"description="Tasks to pick up by newcomers to the project"name="good first issue"
同步
现在您的计算机上有一个代表github问题的文件 标签,您可以编辑此文件,然后运行labels sync来更新 远程存储库。但首先让我们看看它是如何工作的…
在写入的toml文件中表示github问题标签:
[docs]color="2abf88"description="Tasks to write and update documentation"name="docs"
节名([docs]
在上面的示例中)表示
该存储库的标签,与运行时的name
字段相同
labels fetch
。不要自行编辑现有标签的节名!
字段color
、description
和name
是
可以使用标签进行编辑。
name
-标签的名称description
-标签的简短说明color
-标签的十六进制颜色代码,不带前导#
您可以进行以下更改,为您的回购发行标签:
- 通过从 标签文件
- 通过更改一个或多个参数的值,可以edit标签 那个标签
- 您可以create添加一个新的带有您所需的 参数
创建标签时,请选择与name
相同的节名称。
参数。
使用dryrun
cli选项在同步之前检查标签更改:
-n, --dryrun Do not modify remote labels
示例用法:
$ labels sync -n -o hackebrot -r pytest-emoji
This would delete the following labels: - dependencies This would update the following labels: - bug - good first issue This would create the following labels: - duplicate This would NOT modify the following labels: - code quality - docs
在不使用dryrun
选项的情况下运行labels sync
也会更新标签
文件,以便节名称与name
参数匹配。
如果labels在向github api发送请求时遇到任何错误, 它将打印有关故障的信息并继续下一个 直到它处理完所有的标签。
社区
您是否有兴趣参与labelscli应用程序,或帮助我们 改进我们的文档,或者对如何改进项目有想法?
阅读我们的contributing guide并查看 good first issue任务的标签,这是您的 对labels的第一个贡献。你的贡献很大 谢谢!一点一滴的帮助,总是会有功劳的!
请注意,labels是用 Contributor Code of Conduct。参与其中 你同意遵守它的条款。
许可证
根据麻省理工学院的许可条款发行,labels是免费开放的 源软件。