pull
pull copied to clipboard
rfc: make consumable as library
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
Likewise, I wish there was a hosted version, maybe based on GitHub Actions?
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!
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.