V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
helloqiuqiuqiu
V2EX  ›  分享创造

自动 close issue 的 GitHub App

  •  
  •   helloqiuqiuqiu ·
    helloqiu · 2018-07-04 00:09:20 +08:00 · 1623 次点击
    这是一个创建于 2162 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在管理自己的 repo 时,你是否发现会有某些用户提出的 issue 低质或表述不清,又或者你为了改善这一现象提供了 issue template,却还是有用户将之忽视?
    在这种时候,你是否期待着能把这些 issue 自动关闭 的功能?
    对于不规范 issue 的管理是十分必要的,因为这样做可以减少维护者的精力,且很多出名的项目已经在这么做了,比如 vue 的 issue bot
    所以我们创建了一个这样的 Github App: https://probot.github.io/apps/close-issue/

    App 整体使用了 TypeScriptProbot,这也是我第一次使用 TypeScript 写 node 的应用。

    为了使用这个 App,你只需要在 repo 加入一个配置文件,比如这样:

    comment: "This issue is closed because it does not meet our issue template. Please read it."
    issueConfigs:
    - content:
    # Example 1: bug report
      - "Expected Behavior"
      - "Current Behavior"
      - "Steps to Reproduce"
      - "Detailed Description"
    - content:
    # Example 2: feature request
      - "Motivation / Use Case"
      - "Expected Behavior"
      - "Other Information"
    

    通过配置文件设定了关键词之后,如果新提出的 issue 没有包含一个 content 内的所有关键词,那么我们的 App 就会帮你自动 close 掉这个 issue,并作出设定的评论。 经过我的不断努力,我把它安利进了 probot 的展示页面,虽然目前排在最后一个 QAQ
    所以在这里安利给需要的人,如果觉得有帮助也可以点个 star~
    https://github.com/offu/close-issue-app

    weishu
        1
    weishu  
       2018-07-04 16:57:51 +08:00
    非常需要,先表示感谢,然后试用一下;回来给评价!
    weishu
        2
    weishu  
       2018-07-04 17:19:20 +08:00
    @weishu 测试了一下,使用正常;能满足基本需求。已 star ~

    PS: 能否 close 的时候加个 label?

    测试地址:
    https://github.com/android-hacker/VirtualXposed/issues/297
    https://github.com/android-hacker/VirtualXposed/issues/296
    helloqiuqiuqiu
        3
    helloqiuqiuqiu  
    OP
       2018-07-04 21:42:19 +08:00   ❤️ 1
    @weishu 后续应该会支持~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1693 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:44 · PVG 00:44 · LAX 09:44 · JFK 12:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.