{"id":15140370,"url":"https://github.com/adobe/probot-serverless-openwhisk","last_synced_at":"2025-09-29T08:32:00.350Z","repository":{"id":34304482,"uuid":"149264155","full_name":"adobe/probot-serverless-openwhisk","owner":"adobe","description":"Openwhisk Wrapper for Probot","archived":true,"fork":false,"pushed_at":"2022-10-10T06:59:13.000Z","size":2940,"stargazers_count":2,"open_issues_count":0,"forks_count":6,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-01-13T22:23:44.477Z","etag":null,"topics":["github-app","helix","library","openwhisk","probot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adobe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-18T09:40:21.000Z","updated_at":"2023-01-27T20:24:56.000Z","dependencies_parsed_at":"2022-08-08T00:15:55.807Z","dependency_job_id":null,"html_url":"https://github.com/adobe/probot-serverless-openwhisk","commit_stats":null,"previous_names":["tripodsan/probot-serverless-openwhisk"],"tags_count":104,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fprobot-serverless-openwhisk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fprobot-serverless-openwhisk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fprobot-serverless-openwhisk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fprobot-serverless-openwhisk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adobe","download_url":"https://codeload.github.com/adobe/probot-serverless-openwhisk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234604487,"owners_count":18859164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-app","helix","library","openwhisk","probot"],"created_at":"2024-09-26T08:02:45.229Z","updated_at":"2025-09-29T08:31:55.012Z","avatar_url":"https://github.com/adobe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless Probot on Openwhisk\n\u003e A wrapper to run a GitHub App built with [Probot](https://probot.github.io) as an OpenWhisk action. \n\nRunning a Probot app in OpenWhisk might be a bit challenging as the action invocation params need to\nbe translated into a probot event. This package offers an easy wrapper to turn an existing\nprobot app into an OpenWhisk action.\n\nTable of Contents\n=================\n\n   * [Serverless Probot on Openwhisk](#serverless-probot-on-openwhisk)\n      * [Status](#status)\n      * [Setup](#setup)\n      * [Passing the OpenWhisk action params into the handler](#passing-the-openwhisk-action-params-into-the-handler)\n      * [CLI](#cli)\n         * [Automatically deploy to openwhisk](#automatically-deploy-to-openwhisk)\n         * [Automatically \u003cem\u003etest\u003c/em\u003e the deployed action](#automatically-test-the-deployed-action)\n         * [Including action parameters](#including-action-parameters)\n         * [Including static files](#including-static-files)\n         * [Specifying the arguments in the package.json](#specifying-the-arguments-in-the-packagejson)\n      * [Enabling local development](#enabling-local-development)\n      * [Notes](#notes)\n         * [Bundling](#bundling)\n      * [Contributing](#contributing)\n      \n## Status\n[![GitHub license](https://img.shields.io/github/license/adobe/probot-serverless-openwhisk.svg)](https://github.com/adobe/probot-serverless-openwhisk/blob/main/LICENSE.txt)\n[![GitHub issues](https://img.shields.io/github/issues/adobe/probot-serverless-openwhisk.svg)](https://github.com/adobe/probot-serverless-openwhisk/issues)\n[![CircleCI](https://img.shields.io/circleci/project/github/adobe/probot-serverless-openwhisk.svg)](https://circleci.com/gh/adobe/probot-serverless-openwhisk)\n[![codecov](https://img.shields.io/codecov/c/github/adobe/probot-serverless-openwhisk.svg)](https://codecov.io/gh/adobe/probot-serverless-openwhisk)\n\n[![LGTM Code Quality Grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/adobe/probot-serverless-openwhisk.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/adobe/probot-serverless-openwhisk)\n\n## Setup\n\n1. Create a [Probot](https://probot.github.io) app following GitHub's instructions\n\n2. Add this wrapper as dependency:\n    ```sh\n    # Add OpenWhisk wrapper as dependency \n    npm add probot-serverless-openwhisk\n    npm add --save-dev openwhisk-probot-builder\n    ```\n\n3. Add an `index.js`:\n    ```js\n    const { OpenWhiskWrapper, ViewsHelper } = require('@adobe/probot-serverless-openwhisk');\n    const app = require('./src/probot_app.js');\n    \n    const wrapper = new OpenWhiskWrapper()\n      .withViewsDirectory('./src/views')\n      .withApp(app)\n      .withApp(new ViewsHelper()\n        .withView('/docs', 'docs.hbs')\n        .register());\n\n    module.exports = {\n      main: wrapper.create(),\n      wrapper,\n    };\n    ```\n\n4. Build the OpenWhisk action\n    ```sh\n    $ ./node_modules/.bin/wskbot\n    ...\n    Created action: dist/probot-openwhisk-example.zip.\n    ```\n5. Deploy the OpenWhisk action\n    ```sh\n    $ wsk action update probot-openwhisk-example --kind nodejs:10 --web raw dist/probot-openwhisk-example.zip\n    ```\n\n6. Set the correct [GitHub app settings](https://github.com/settings/apps):    \n    \n    * **Homepage URL:** https://adobeioruntime.net/api/v1/web/$WSK_NAMESPACE/default/probot-openwhisk-example/probot\n    * **Webhook URL:** https://adobeioruntime.net/api/v1/web/$WSK_NAMESPACE/default/probot-openwhisk-example\n\n## Passing the OpenWhisk action params into the handler\n\nSometimes the handler needs access to the action params, especially if they are deployment provided\nand might contain keys or tokens. This wrapper passes them along when it initializes the handler with an additional\nargument. \n\nExample:\n\n```js\nmodule.exports = (app, actionParams = {}) =\u003e {\n  app.log('Yay, my app is loaded');\n\n  const MY_TOKEN = actionParams.MY_TOKEN || '';\n  .\n  .\n```\n\nThe deploy parameters can be specified in the CLI via `-p`. See below.\n\n## CLI\n\nThe command-line interface `wskbot` can be invoked via `./node_modules/.bin/wskbot`. \nAlternatively, you can also use npx: `npx wskbot` or install it globally `npm install -g probot-serverless-openwhisk`.\n\n```\n$ wskbot --help\nOperation Options\n  --build              Build the deployment package    [boolean] [default: true]\n  --deploy             Automatically deploy to OpenWhisk\n                                                      [boolean] [default: false]\n  --test               Invoke action after deployment [boolean] [default: false]\n  --hints, --no-hints  Show additional hints for deployment\n                                                       [boolean] [default: true]\n  --update-package     Create or update wsk package.  [boolean] [default: false]\n\nOpenWhisk Action Options\n  --name             OpenWhisk action name. Can be prefixed with package.\n  --kind             Specifies the action kind.                    [default: \"\"]\n  --docker           Specifies a docker image.\n  --params, -p       Include the given action param. can be json or env.\n                                                           [array] [default: []]\n  --params-file, -f  Include the given action param from a file; can be json or\n                     env.                                  [array] [default: []]\n  --web-export       Annotates the action as web-action[boolean] [default: true]\n  --raw-http         Annotates the action as raw web-action (enforces\n                     web-export=true)                  [boolean] [default: true]\n\nOpenWhisk Package Options\n  --package.name         OpenWhisk package name.                        [string]\n  --package.params       OpenWhisk package params.         [array] [default: []]\n  --package.params-file  OpenWhisk package params file.    [array] [default: []]\n  --package.shared       OpenWhisk package scope.     [boolean] [default: false]\n\nBundling Options\n  --static, -s  Includes a static file into the archive    [array] [default: []]\n  --entryFile   Specifies the entry file.              [default: \"src/index.js\"]\n  --externals   Defines the externals for webpack.         [array] [default: []]\n\nGitHub Options\n  --github-key  Specify the GitHub private key file\n\nOptions:\n  --version      Show version number                                   [boolean]\n  --verbose, -v                                       [boolean] [default: false]\n  --pkgVersion   Version use in the embedded package.json.\n  --modules, -m  Include a node_module as is.              [array] [default: []]\n  --help         Show help                                             [boolean]\n```\n\nWith no arguments, the `wskbot` just bundles your code into the respective `action.zip`:\n\n```\n$ wskbot\nok: created action: dist/probot-openwhisk-example.zip.\nDeploy to openwhisk the following command or specify --deploy on the commandline:\n$ wsk action update probot-openwhisk-example --kind nodejs:10 --web raw dist/probot-openwhisk-example.zip\n\nGitHub App Settings:\nHomepage URL: https://adobeioruntime.net/api/v1/web/tripod/default/probot-openwhisk-example/probot\n Webhook URL: https://adobeioruntime.net/api/v1/web/tripod/default/probot-openwhisk-example\n```\n\n### Automatically deploy to openwhisk\n\nWhen passing the `--deploy` argument, the `wskbot` will try to deploy it to OpenWhisk using the settings from\n`~/.wskprops`. Alternatively, you can also set the `WSK_NAMESPACE`, `WSK_AUTH`, `WSK_APIHOST` variables in your\nenvironment or `.env` file.\n\n```\n$ wskbot --deploy --no-hints\nok: created action: dist/probot-openwhisk-example.zip.\nok: updated action tripod/probot-openwhisk-example\n```  \n\n### Automatically _test_ the deployed action\n\nTo quickly test the deployed action, `wskbot` can send a `GET` request to the action url.\n\n```\n$ wskbot --deploy --no-hints --test\nok: created action: dist/probot-openwhisk-example.zip.\nok: updated action tripod/probot-openwhisk-example\n--: requesting: https://runtime.adobe.io/api/v1/web/tripod/default/probot-openwhisk-example ...\nok: 200\n```\n\n..or sometimes:\n\n```\n$ wskbot --deploy --no-hints --test\nok: created action: dist/probot-openwhisk-example.zip.\nok: updated action tripod/probot-openwhisk-example\n--: requesting: https://runtime.adobe.io/api/v1/web/tripod/default/probot-openwhisk-example ...\nerror:  400 - \"{\\n  \\\"error\\\": \\\"Response is not valid 'message/http'.\\\",\\n  \\\"code\\\": \\\"av6qzDTHdgd5dfg7WOynEjbVnTdE5JhnB4c\\\"\\n}\"\n```\n\n### Including action parameters\n\nAction parameters can be defined via `-p`, either as json on env string, or json or env file.\n\nExamples:\n\n```bash\n# specify as env string\nwskbot -p MY_TOKEN=1234 -p MY_PWD=foo\n\n# specify as json string\nwskbot -p '{ \"MY_TOKEN\": 1234, \"MY_PWD\": \"foo\" }'\n\n# specify as env file\nwskbot -p .env\n\n# specify as json file\nwskbot -p params.json\n\n# and a combination of the above\nwskbot -p .env -p params.json -p MY_TOKEN=123\n\n# like in curl, you can include file contents with `@` (also works in .env or .json file)\nwskbot -p MY_TOKEN=@token.txt\n```\n\n### Including static files\n\nAdding static files, i.e. files that are not referenced from the `index.js` and detected by webpack,\ncan be done via the `-s` parameter. they are always put into the root directory of the archive.\n\nExample:\n\n```bash\n# include an image\nwskbot -s logo.png\n```\n \n### Specifying the arguments in the `package.json`\n\nInstead of having very a long argument list, the parameters described above can also be specified in\nthe `package.json`. see the [action-builder documentation](https://github.com/adobe/openwhisk-action-builder#specifying-arguments-in-the-packagejson)\nfor more details. \n\n## Enabling local development\n\nIn your github app project, create a `dev.js` with:\n\n```js\nconst { DevelopmentServer } = require('@adobe/probot-serverless-openwhisk');\nconst { wrapper } = require('./index.js');\n\nasync function run() {\n  const devServer = await new DevelopmentServer(wrapper).init();\n  return devServer.run();\n}\n\nrun().then(process.stdout).catch(process.stderr);\n```\n\nand then run `node dev.js`. this starts a probot server which an optional smee.io client.\nyou can add the smee url via a `WEBHOOK_PROXY_URL` entry in the `.env` file.\n\n## Notes\n\n### Bundling\n\nThe action is created using webpack to create a bundle for the sources and then creates a zip archive\nwith the bundle, a `package.json`, the private key files and the `.env`.\n\n## Contributing\n\nIf you have suggestions for how this OpenWhisk probot wrapper could be improved, or want to report a bug, open an issue! We'd love all and any contributions.\n\nFor more, check out the [Contributing Guide](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadobe%2Fprobot-serverless-openwhisk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadobe%2Fprobot-serverless-openwhisk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadobe%2Fprobot-serverless-openwhisk/lists"}