Skip to content

adobe-apiplatform/openwhisk-kegbot-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenWhisk Action for Slack

This is a sample OpenWhisk project showing how to write actions that interact with Slack using node-slack-sdk.

Building

npm install

This command installs the node modules and generates the source code for the action at slack-action-0.0.1.js.

The ES6 code for the action is found in src/action/slack-action.js and the other files are bundled with the code of the action.

The bundle eventually exposes the main variable/function in order for OpenWhisk to invoke the action correctly:

var main = require('main-action');

Running the tests locally

 npm test

Running the action in OpenWhisk

First make sure you have an Incoming WebHook URL for a Slack Channel.

Then create the action:

> wsk -i action create slack-action ./slack-action-0.0.1.js --param slack_webhook_url https://hooks.slack.com/services/T000000/B00000000/V000000000

ok: created action slack-action

Then invoke the action:

> wsk -i action invoke slack-action --blocking

To delete the action:

> wsk -i action delete slack-action
 
ok: deleted action slack-action

About

Serverless function for kegbot to post to slack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published