hubot-github-repo-event-notifier
hubot-github-repo-event-notifier copied to clipboard
Custom Actions
I would like to trigger a custom action on release
event type, in order to print the body text & release name with markdown. What's the best approach for overriding eventActions = require('./event-actions/all')
Cheers!
Might be related to: https://github.com/hubot-scripts/hubot-github-repo-event-notifier/issues/23
Maybe having a way to override eventActions
, would something like this works?:
_ = require('lodash');
//...
eventActions = require('./event-actions/all')
customConsumerActions = require('utils/custom-actions');
_assign(eventActions, customConsumerActions);
//..
Then utils/custom-actions.js
would live in the consumer's app file structure & look like this:
export function release(adapter, data, cb) {
callback(`
# ${data.action}: ${data.release}
${data.release.html_url}
---
${data.release.body}
`);
}
Thoughts?