All Projects → xuexb → Github Bot

xuexb / Github Bot

Licence: mit
GitHub 自动处理 issue、PR、releases 机器人

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Github Bot

Derek
Reduce maintainer fatigue by automating GitHub
Stars: ✭ 714 (+64.52%)
Mutual labels:  bot, robot, pull-requests
Reviewbot
Reviewbot is a Slack bot that shows reviewable pull requests.
Stars: ✭ 40 (-90.78%)
Mutual labels:  bot, pull-requests
Kodiak
🔮 A bot to automatically update and merge GitHub PRs
Stars: ✭ 644 (+48.39%)
Mutual labels:  bot, pull-requests
Wechat Go
go version wechat web api and message framework for building wechat robot
Stars: ✭ 1,381 (+218.2%)
Mutual labels:  bot, robot
Lock Threads
GitHub Action that locks closed issues and pull requests after a period of inactivity
Stars: ✭ 156 (-64.06%)
Mutual labels:  pull-requests, issues
Github Issue Templates
🔣 A collection of GitHub issue and pull request templates
Stars: ✭ 3,074 (+608.29%)
Mutual labels:  pull-requests, issues
Lua Mirai
基于mirai-core api的lua快速开发框架。
Stars: ✭ 77 (-82.26%)
Mutual labels:  bot, robot
Gha Mjolnir
🔨 GitHub Action to close issues related to the merge of a pull request.
Stars: ✭ 28 (-93.55%)
Mutual labels:  pull-requests, issues
Chatapi Wechat
Java版本微信聊天接口,使用网页微信API,让你能够开发自己的微信聊天机器人
Stars: ✭ 207 (-52.3%)
Mutual labels:  bot, robot
release-changelog-builder-action
A GitHub action that builds your release notes / changelog fast, easy and exactly the way you want.
Stars: ✭ 515 (+18.66%)
Mutual labels:  issues, pull-requests
aloba
🤖 [Myrmica Aloba 🐜] Bot: Add labels and milestone on pull requests and issues.
Stars: ✭ 18 (-95.85%)
Mutual labels:  issues, pull-requests
Github Project Automation Plus
🤖 Automate GitHub Project cards with any webhook event
Stars: ✭ 134 (-69.12%)
Mutual labels:  pull-requests, issues
Export Pull Requests
Export pull requests and/or issues to a CSV file. Supports GitHub, GitLab, and Bitbucket
Stars: ✭ 68 (-84.33%)
Mutual labels:  pull-requests, issues
Repo Lockdown
GitHub Action that immediately closes and locks issues and pull requests
Stars: ✭ 56 (-87.1%)
Mutual labels:  pull-requests, issues
backup-github-repo
Backup all the issues and pull requests of a Github repo, including the comments, events, and labels, as JSON and as HTML
Stars: ✭ 31 (-92.86%)
Mutual labels:  issues, pull-requests
Telegram Pm Chat Bot
Telegram Private Message Chat Bot
Stars: ✭ 69 (-84.1%)
Mutual labels:  bot, robot
Contribute A Thon
Month-long Open Source contributing event ✨
Stars: ✭ 26 (-94.01%)
Mutual labels:  pull-requests, issues
List of robot electronics
A curated list of awesome open source electronic resources for robotics
Stars: ✭ 106 (-75.58%)
Mutual labels:  bot, robot
assign-author
GitHub Actions to assign author to issue or PR
Stars: ✭ 55 (-87.33%)
Mutual labels:  issues, pull-requests
Contributors On Github
🌵 Show stats about contributors on github
Stars: ✭ 391 (-9.91%)
Mutual labels:  pull-requests, issues

github-bot

github 机器人:在服务端上启动一个基于 koajs 的 http server ,建立一些项目的规范(如 issue 格式、 pull request 格式、配置一些指定 label 根据的 owner 、统一 git commit log 格式等),基于 github webhooksgithub api 让机器人(通常是一个单独的帐号,如 @jiandansousuo-bot )自动处理一些事情,从而达到快速响应、自动化、解放人力的效果。

Build Status js-standard-style Test Coverage

声明

仓库@xuexb/github-bot 是用来演示 github-bot 的基本功能,因为具体需要实现的功能,可能因项目而不同,如果你需要她,你可以 fork 并相应的添加、删除功能。以下功能是一些常用的 show case 。

功能 - Feature

Issue

  • [x] 没有使用 创建 issue 页面提交的 issue 将直接被关闭 - 示例
  • [x] 根据 创建 issue 页面提交的 issue 类型自动打上对应 label - 示例
  • [x] 当 issue 标记 label 为 need demo 时,自动回复,需要相关demo - 示例
  • [x] issue 自动 assign 给指定人员,需要配置 package.jsonconfig.github-bot.labelToAuthor 映射 - 示例

Pull Request

  • [x] 发 PR 时根据打的 label 自动添加指定的 reviewer ,需要配置 package.jsonconfig.github-bot.labelToAuthor 映射 - 示例
  • [x] 发 PR 时标题不规范时提醒修改,需要配置 package.jsonconfig.validate-commit-msg.type 功能关键字,标题必须以 功能关键字: 开头 - 示例
  • [x] 发 PR 时自动根据标题的 PR 标题规则 前缀生成对应的 label , feat->enhancement, fix->bug - 示例

Release

  • [x] 当往远程第一次推送新版本号时,自动列出最新版本距离上一版本的 commit log 并发布 release notes ,由于需要使用两个 tag 去对比,所以项目的第一个 tag 就不处理 - 示例

规则 - Rules

issue 规则

必须使用 创建 issue 页面来提交 issue ,否则将直接被关闭

labels 规则

  • invalid - 未定义, 内容 不规范
  • need demo - 需要提供预览链接
  • need update - 需要更新修复问题
  • bug - bug
  • duplicate - 重复
  • enhancement - 新功能
  • question - 提问
  • wontfix - 不修复的问题

commit log 和 PR 标题规则

所有标题必须以 功能关键字: 开头

参考: http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html

功能关键字介绍如下:

  • feat - 新功能(feature)
  • fix - 修补bug
  • docs - 文档(documentation)
  • style - 格式(不影响代码运行的变动)
  • test - 增加测试
  • chore - 构建过程或辅助工具的变动
  • revert - 撤销
  • close - 关闭 issue
  • release - 发布版本

示例:

close: #1, #3
feat: 添加xx功能
docs: update install info

如何使用

1. 创建 access tokens

https://github.com/settings/tokens需要在 .env 里配置

2. 创建 webhook

https://github.com/用户名/项目名/settings/hooks/new

  • Payload URL: www.example.com:8000
  • Content type: application/json
  • trigger: Send me everything.
  • Secret: xxx (需要在 .env 里配置

3. 开发运行

npm install
cp env .env
vim .env
npm start

4. 部署

本项目使用 pm2 进行服务管理,发布前请先全局安装 pm2

npm install pm2 -g
npm run deploy

后台启动该服务后,可以通过 pm2 ls 来查看服务名称为 github-bot 的运行状态。具体 pm2 使用,请访问:https://github.com/Unitech/pm2

5. 日志系统说明

本系统 logger 服务基于 log4js。 在根目录的 .env 文件中有个参数 LOG_TYPE 默认为 console,参数值说明:

console - 通过 console 输出log。
file - 将所有相关log输出到更根目录的 `log` 文件夹中。

contributors

用户贡献指南

Liscense

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].