pull icon indicating copy to clipboard operation
pull copied to clipboard

rfc: make consumable as library

Open cdaringe opened this issue 4 years ago • 3 comments

Problem

I have a probot application, and want to tap into this functionality. However, this code is not distributed on npm.

Discussion

Can we:

  • publish to npm
  • export mappings between event-name:handler

in this regard, I can import pull and bind them to my existing event handlers

cdaringe avatar Jun 10 '20 20:06 cdaringe

Likewise, I wish there was a hosted version, maybe based on GitHub Actions?

MaxDesiatov avatar Jun 10 '20 20:06 MaxDesiatov

Great idea, I'll definitely consider it for a future release!

@cdaringe Do you have an example package on npm that provides event handler bindings for us to model after?

@MaxDesiatov Probot v11 has serverless deployments on its roadmap including GitHub Actions support. I'm looking forward to it!

wei avatar Aug 19 '20 01:08 wei

Sure! https://github.com/cdaringe/semantic-pull-requests/blob/feat/publish/index.js

semantic exports a single function that takes the app and registers handlers. That's a great start! I'd advocate for finer grain control as well, just exporting the handler and letting us call into the handler. Maybe also export the default events that would be bound to it.

cdaringe avatar Aug 19 '20 01:08 cdaringe