GitHub
ts
import { Hibiki } from "@hibiki-js/core"
import { github } from "@hibiki-js/github"
const app = new Hibiki().use(github({
secret: process.env.GITHUB_WEBHOOK_SECRET!,
}))受け付けるのは application/json のみです。その他の GitHub イベントはデフォルトで 200(strictEvents: true なら 400)です。
対応イベント
pushpingcreatedeletepull_request.openedpull_request.closedpull_request.reopenedpull_request.synchronizepull_request.ready_for_reviewpull_request.labeledpull_request_review.submittedissues.openedissues.closedissues.reopenedissue_comment.createdrelease.publishedworkflow_run.completedworkflow_job.completedcheck_suite.completedcheck_run.completeddeployment.createddeployment_status.created
ハンドラは github. プレフィックスを使います。
ts
app.on("github.pull_request.opened", async ({ event }) => {
console.log(event.pull_request.number, event.repository.full_name)
})オプションと型の詳細は API リファレンス を参照してください。
