Follow the exercise from https://probot.github.io/docs/development.
Bonus:
-
Open your probot source directory in VSCode.
-
Add a new VSCode Launch config (Run > Add Configuration):
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Probot",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/<my-app-path>/node_modules/probot/bin/probot.js",
"args": ["run", "./index.js"],
"cwd": "${workspaceFolder}/<my-app-path>",
"console": "integratedTerminal",
}
]
}
- Add a breakpoint to the line
const issueComment = context.issue({
- Start the debugger
- Create a new issue in your repository and observe the stack content at the breakpoint