Skip to content

Commit

Permalink
fix: remove obsolete and invalid events & actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Dec 11, 2018
1 parent f66a852 commit bff3b74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
12 changes: 0 additions & 12 deletions lib/webhook-names.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@
"check_suite.rerequested",
"commit_comment",
"commit_comment.created",
"content_reference",
"create",
"delete",
"deployment",
"deployment_status",
"download",
"error",
"follow",
"fork",
"fork_apply",
"gist",
"github_app_authorization",
"gollum",
"installation",
Expand Down Expand Up @@ -81,20 +76,16 @@
"ping",
"project",
"project.closed",
"project.converted",
"project.created",
"project.deleted",
"project.edited",
"project.moved",
"project.reopened",
"project_card",
"project_card.closed",
"project_card.converted",
"project_card.created",
"project_card.deleted",
"project_card.edited",
"project_card.moved",
"project_card.reopened",
"project_column",
"project_column.created",
"project_column.deleted",
Expand All @@ -105,15 +96,12 @@
"pull_request.assigned",
"pull_request.closed",
"pull_request.edited",
"pull_request.false",
"pull_request.labeled",
"pull_request.merged",
"pull_request.opened",
"pull_request.reopened",
"pull_request.review_request_removed",
"pull_request.review_requested",
"pull_request.synchronize",
"pull_request.true",
"pull_request.unassigned",
"pull_request.unlabeled",
"pull_request_review",
Expand Down
11 changes: 2 additions & 9 deletions scripts/update-known-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ const WEBOOOKS = require('@octokit/webhooks-definitions')
const newWebhookNames = WEBOOOKS.reduce((list, event) => {
list.push(event.name, ...event.actions.map(action => `${event.name}.${action}`))
return list
}, ['*', 'error'])
}, ['*', 'error']).sort()

// the documentation at https://developer.github.com/v3/activity/events/types/#labelevent
// does not include all actions, or the actions are not formatted correctly.
// So for the time being we merge into the current webhook names to prevent
// events or actions from being removed
const currentWebhookNames = require('../lib/webhook-names')
const webhookNames = new Set(newWebhookNames.concat(currentWebhookNames).sort())

writeFileSync('lib/webhook-names.json', JSON.stringify([...webhookNames], null, 2) + '\n')
writeFileSync('lib/webhook-names.json', JSON.stringify([...newWebhookNames], null, 2) + '\n')

0 comments on commit bff3b74

Please sign in to comment.