Module: GithubWebhook::Processor

Extended by:
ActiveSupport::Concern
Defined in:
lib/github_webhook/processor.rb

Constant Summary collapse

GITHUB_EVENTS =

To fetch list from developer.github.com/v3/activity/events/types run this little JS code in the console:

document.querySelectorAll('.list-style-none li.lh-condensed a').forEach(e => console.log(e.text))
%w(
  check_run
  check_suite
  code_scanning_alert
  commit_comment
  content_reference
  create
  delete
  deploy_key
  deployment
  deployment_status
  discussion
  discussion_comment
  fork
  github_app_authorization
  gollum
  installation
  installation_repositories
  issue_comment
  issues
  label
  marketplace_purchase
  member
  membership
  meta
  milestone
  organization
  org_block
  package
  page_build
  ping
  project_card
  project_column
  project
  public
  pull_request
  pull_request_review
  pull_request_review_comment
  push
  release
  repository_dispatch
  repository
  repository_import
  repository_vulnerability_alert
  secret_scanning_alert
  security_advisory
  sponsorship
  star
  status
  team
  team_add
  watch
  workflow_dispatch
  workflow_run
)

Instance Method Summary collapse

Instance Method Details

#createObject



69
70
71
72
73
74
75
76
# File 'lib/github_webhook/processor.rb', line 69

def create
  if self.respond_to?(event_method, true)
    self.send event_method, json_body
    head(:ok)
  else
    raise AbstractController::ActionNotFound.new("GithubWebhooksController##{event_method} not implemented")
  end
end

#github_ping(payload) ⇒ Object



78
79
80
81
# File 'lib/github_webhook/processor.rb', line 78

def github_ping(payload)
  GithubWebhook.logger && GithubWebhook.logger.info("[GithubWebhook::Processor] Hook ping "\
    "received, hook_id: #{payload[:hook_id]}, #{payload[:zen]}")
end