Regular actions
Below is an example to help you understand how you can create a regular action on any Tegon event.
Example Task
Bug Enricher
Whenever an issue is created in Tegon and labeled as bug
then create an action which call OpenAI to search for possible solution and put the solution as a comment of that issue.
- Create a new folder for this action
- Now run our cli command, this will create the basic folder structure for action.
- Let’s edit the config.json as below to tell Tegon to trigger the function when issue is created.
bug-resolution/config.json
- Then let’s edit the
index.ts
with the below content
bug-resolution/index.ts
You can check the prompt here.
- Finally you can deploy the action to your workspace.
You can find the whole code for this example trigger here
Was this page helpful?