Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
feat: add branch create event (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: Calvin Wai <[email protected]>
  • Loading branch information
wai-calvin and Calvin Wai authored Jan 28, 2022
1 parent 4c916e5 commit 80c686a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {App, createNodeMiddleware} = require("@octokit/app");
const { App, createNodeMiddleware } = require("@octokit/app");
const morgan = require("morgan");
const express = require("express");
const expressApp = express();
Expand Down Expand Up @@ -29,10 +29,10 @@ const protection_events = [
"branch_protection_rule.created",
"branch_protection_rule.edited",
"branch_protection_rule.deleted",
"repository.transferred"
"create"
]

app.webhooks.on(protection_events, async ({octokit, payload}) => {
app.webhooks.on(protection_events, async ({ octokit, payload }) => {
console.log(payload);

if (payload.sender.type !== 'Bot') {
Expand All @@ -41,7 +41,7 @@ app.webhooks.on(protection_events, async ({octokit, payload}) => {
{
owner: payload.repository.owner.login,
repo: payload.repository.name,
branch: "main",
branch: payload.repository.default_branch,
required_status_checks: {
contexts: [],
strict: true,
Expand Down

0 comments on commit 80c686a

Please sign in to comment.