# 接入 GitHub Webhook beta

koishi-plugin-github-webhook 支持接收 GitHub Webhook 并转发到 QQ。

# 配置

这个插件的配置分为两部分。首先你需要在配置文件或传入 App 的选项中加一个 githubWebhook 属性,它用来控制服务器信息;而插件的选项则表示接收哪些仓库的 webhook 并转发到哪些群。下面是一个例子:

koishi.config.js
module.exports = {
  // 这里是默认值,secret 不能留空,否则 @octokit/webhooks 会报错
  githubWebhook: {
    path: '/',
    port: 12140,
    secret: '',
  },
  plugins: [['github-webhook', {
    // 当检测到 user/repo1 发生的事件时转发到 123,456 两个群
    'user/repo1': [123, 456],
  }]],
}

# 示例

这一节展示了目前本插件支持的事件。全部取自真正触发在 koishijs/koishi 仓库的事件。

# Push

# Normal Push

Koishi

[GitHub] Push (koishijs/koishi)

Ref: refs/heads/develop

User: Shigma

Compare: https://github.com/koishijs/koishi/compare/976c6e8f09a4...3ae7e7044d06

chore: adjust

fix(core): create major context at demand

# Release Tag

Koishi

[GitHub] koishijs/koishi published tag 1.5.0

# Commit Comment

Koishi

[GitHub] Commit Comment (koishijs/koishi)

User: Shigma

URL: https://github.com/koishijs/koishi/commit/bff469eabe14d42683a4f7c3ccb659daec5e1c00#commitcomment-36878220

This will introduce a failure in test.

# Issue

# Issue Open

Koishi

[GitHub] Issue Opened (koishijs/koishi#19)

Title: Wie kann man um das Koishi zu installieren?

User: simon300000

URL: https://github.com/koishijs/koishi/issues/19

Ich verstecke Englisch und Chinesisch nicht! Gab es Personen, die mir helfen kann?

# Issue Comment

Koishi

[GitHub] Issue Comment (koishijs/koishi#19)

User: simon300000

URL: https://github.com/koishijs/koishi/issues/19#issuecomment-576277946

Mich würde auch interessieren, was ist „CoolQ“?

# Pull Request

# Pull Request Open

Koishi

[GitHub] Pull Request Opened (koishijs/koishi#364852707)

koishijs:develop <- koishijs:experimental

User: simon300000

URL: https://github.com/koishijs/koishi/pull/20

Das ist wichtig!

# Pull Request Comment

Koishi

[GitHub] Pull Request Comment (koishijs/koishi#20)

User: Kouchya

URL: https://github.com/koishijs/koishi/pull/20#issuecomment-576291300

C'est important!

# Pull Request Review

Koishi

[GitHub] Pull Request Review (koishijs/koishi#364852707)

User: Kouchya

URL: https://github.com/koishijs/koishi/pull/20#pullrequestreview-345349537

LGTM

# Pull Request Review Comment

Koishi

[GitHub] Pull Request Review (koishijs/koishi#364852707)

Path: packages/test-utils/src/mocks.ts

User: Shigma

URL: https://github.com/koishijs/koishi/pull/20#discussion_r368570320

Naming is so hard......