Skip to content

Commit

Permalink
fix: remove obsolete events: download, follow, fork_apply, gist
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Dec 11, 2018
1 parent 824a21b commit 9bb348f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
20 changes: 0 additions & 20 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1188,16 +1188,6 @@
}
]
},
{
"name": "download",
"actions": [],
"examples": []
},
{
"name": "follow",
"actions": [],
"examples": []
},
{
"name": "fork",
"actions": [],
Expand Down Expand Up @@ -1413,11 +1403,6 @@
}
]
},
{
"name": "fork_apply",
"actions": [],
"examples": []
},
{
"name": "github_app_authorization",
"actions": [],
Expand Down Expand Up @@ -1447,11 +1432,6 @@
}
]
},
{
"name": "gist",
"actions": [],
"examples": []
},
{
"name": "gollum",
"actions": [],
Expand Down
2 changes: 1 addition & 1 deletion lib/check-or-update-webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function checkOrUpdateWebhooks ({ cached, checkOnly }) {

const html = await getHtml({ cached })
const sections = await getSections(state, html)
const wekhooks = sections.map(toWebhook.bind(null, state))
const wekhooks = sections.map(toWebhook.bind(null, state)).filter(Boolean)

const currentWebhooks = require('../index.json')

Expand Down
5 changes: 5 additions & 0 deletions lib/section-to-webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ const cheerio = require('cheerio')
function sectionHtmlToWebhook (state, section) {
const $ = cheerio.load(section.html)

// ignore obsolete events that are no longer sent
if (/Events of this type are no longer delivered/.test($('.warning').text())) {
return null
}

const webhook = $('h3')
.filter((index, el) => $(el).text().trim() === 'Webhook event name')
.map((index, el) => {
Expand Down

0 comments on commit 9bb348f

Please sign in to comment.