[Github-bot]帮助处理issue和PR的github-bot

个人博客:Sekyoro的博客小屋
个人网站:Proanimer的个人网站

在看一些开源项目时,会发现一些帮忙处理issue和PR的bot,这些bot都是基于Github的AppsGitHub Apps overview - GitHub Docs

GitHub Apps

GitHub应用程序是扩展GitHub功能的工具。GitHub应用程序可以在GitHub上做一些事情,比如打开问题、评论拉取请求和管理项目。他们也可以根据GitHub上发生的事件在GitHub之外做事情。例如,当在GitHub上打开问题时,GitHub应用程序可以在Slack上发布。

可以在GitHub Marketplace上查找Github Apps,然后进行安装,有些是需要付费的.

关于使用直接安装然后看文档进行配置就行了。

如何开发

github/github-app-js-sample: Sample of a GitHub App that comments new pull requests

image-20231224150632938

由于本地开发涉及到需要接受github发来的东西,需要涉及到内网穿透啥的,推荐使用smee或者ngrok进行本地开发.建议搭配下面介绍的probot进行开发.probot.github.io/docs/development/#installing-the-app-on-a-repository

Probot

Probot是一个在Node.js中构建GitHub应用程序的框架。它旨在消除所有的繁琐工作,比如接收和验证Webhook,以及进行身份验证倒立,这样你就可以专注于你想要构建的功能。Probet应用程序易于编写、部署和共享。许多最流行的Probet应用程序都是托管的,所以没有什么可供您部署和管理的。

module.exports = (app) => {
   
  app.on("issues.opened", async (context) => {
   
    const issueComment = context.issue({
   
      body: "Thanks for opening this issue!",
    });
    return context.octokit.issues.createComment(issueComment);
  });

  app.onAny(async (context) => {
   
    context.log.info({
    event: context.name, action: context.payload.action });
  });

  app.onError(async (error) => {
   
    app.log.error(error);
  });
};

Repo Automation Bots

googleapis/repo-automation-bots: A collection of bots, based on probot, for performing common maintenance tasks across the open-source repos managed by Google on GitHub.一组基于probot的机器人,用于谷歌在GitHub上管理的开源转发中执行常见维护任务。下面是一些可用的bot

auto-approve Automatically approves and merges PRs matching user-specified configs install
auto-label Automatically labels issues and PRs with product, language, or directory based labels install
blunderbuss Assigns issues and PRs randomly to a specific list of users install
cherry-pick-bot Cherry-pick merged PRs between branches install

参考资料

  1. probot.github.io/docs/
  2. GitHub Bots for every open-source project - DEV Community
  3. googleapis/repo-automation-bots: A collection of bots, based on probot, for performing common maintenance tasks across the open-source repos managed by Google on GitHub.
  4. smee.io | Webhook deliveries
  5. ngrok | Unified Application Delivery Platform for Developers

如有疑问,欢迎各位交流!

服务器配置
宝塔:宝塔服务器面板,一键全能部署及管理
云服务器:阿里云服务器
Vultr服务器
GPU服务器:Vast.ai

相关推荐

  1. GitHub 上如何提出 issue

    2023-12-27 22:42:02       29 阅读
  2. github注册使用

    2023-12-27 22:42:02       14 阅读
  3. Git Github 使用

    2023-12-27 22:42:02       6 阅读
  4. <span style='color:red;'>Github</span>

    Github

    2023-12-27 22:42:02      33 阅读
  5. GITHUB

    2023-12-27 22:42:02       24 阅读

最近更新

  1. 关于学习方法的优化

    2023-12-27 22:42:02       0 阅读
  2. Nginx重定向

    2023-12-27 22:42:02       0 阅读
  3. Apache Flink 任意 JAR 包上传漏洞利用及防范策略

    2023-12-27 22:42:02       1 阅读
  4. QTreeWidget 树遍历

    2023-12-27 22:42:02       1 阅读
  5. 技术浅谈:如何入门一门编程语言

    2023-12-27 22:42:02       1 阅读

热门阅读

  1. pnpm包管理器

    2023-12-27 22:42:02       45 阅读
  2. git子模块使用关键命令

    2023-12-27 22:42:02       35 阅读
  3. uniapp实现瀑布流

    2023-12-27 22:42:02       32 阅读
  4. 【C++】多线程(四)

    2023-12-27 22:42:02       39 阅读
  5. 随笔笔记-2023

    2023-12-27 22:42:02       36 阅读
  6. 【ENGF0004】Mathematical Modelling and Analysis

    2023-12-27 22:42:02       30 阅读
  7. odoo17核心概念view2——view_service

    2023-12-27 22:42:02       30 阅读
  8. Centos设置IP地址方法

    2023-12-27 22:42:02       35 阅读
  9. Day02-ES6

    2023-12-27 22:42:02       31 阅读
  10. Kotlin 接口

    2023-12-27 22:42:02       34 阅读