cdamian/plus-pull

用于合并Github pull requests的脚本,这些pull requests获得了足够的+1票

v0.8.1 2019-07-23 14:52 UTC

README

Build Status

plus-pull

这是一个简单的脚本,用于检查Github仓库中的pull requests,如果满足某些条件,则会合并它们。

默认情况下,这些条件是

  1. :+1和:-1的总和至少为3
  2. 没有[B]类型的阻塞评论
  3. 请求可合并
  4. (可选)所有构建状态正常

安装

composer.phar create-project cdamian/plus-pull

命令行使用

检查pull requests

check [-p|--pull] [-l|--limit="..."] [config-file]

Arguments:
 config-file           Path of the yaml configuration file (default: "config.yml")

Options:
 --pull (-p)           Pull the request if all conditions are met
 --limit (-l)          Maximum numbers of pull (default: 1)

创建新的github授权token

token:create [--note="..."]

Options:
 --note                Note for the authorization token on github (default: "plus-push")

配置文件

通过配置文件,您可以设置github授权用户名和密码或github授权token。

其他部分设置仓库所有者和名称,您可以更改默认的所需投票数、是否检查状态和投票者白名单。

您还有自动为评论中找到的关键词添加标签的选项。在下面的示例中,如果我们看到评论中有[B],我们将添加带有指定颜色的标签'blocked'。如果标签不存在,将会创建它。

authorization:
    username: christofdamian
    password: secret
    token: githubtoken

repositories:
    -
        username: christofdamian
        name: test
        status: true
        required: 3
        whitelist: [ christofdamian ]
        wait: 300
        mergemode: merge
        labels:
            -
                name: blocked
                color: eb6420
                hook: '[B]'

致谢

我们在工作中使用了一个类似的脚本,由@adriacidre发起。但这完全是一个重写,以使其更容易添加更多功能。

标签支持由@ifosch提供