Skip to content

Commit

Permalink
fix: issue.created to issues.opened
Browse files Browse the repository at this point in the history
  • Loading branch information
sshivaditya committed Sep 13, 2024
1 parent 22679ec commit 2ea6146
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To set up the `.dev.vars` file, you will need to provide the following variables
- Add the following to your `.ubiquibot-config.yml` file with the appropriate URL:
```javascript
-plugin: http://127.0.0.1:4000
runsOn: [ "issue_comment.created", "issue_comment.edited", "issue_comment.deleted" , "issues.created", "issues.edited", "issues.deleted"]
runsOn: [ "issue_comment.created", "issue_comment.edited", "issue_comment.deleted" , "issues.opened", "issues.edited", "issues.deleted"]
```


Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@ubiquity-os/comment-vector-embeddings",
"description": "Issue comment plugin for Ubiquibot. It enables the storage, updating, and deletion of issue comment embeddings.",
"ubiquity:listeners": ["issue_comment.created", "issue_comment.edited", "issue_comment.deleted", "issues.created", "issues.edited", "issues.deleted"]
"ubiquity:listeners": ["issue_comment.created", "issue_comment.edited", "issue_comment.deleted", "issues.opened", "issues.edited", "issues.deleted"]
}
2 changes: 1 addition & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function runPlugin(context: Context) {
}
} else if (isIssueEvent(context)) {
switch (eventName) {
case "issues.created":
case "issues.opened":
return await addIssue(context);
case "issues.deleted":
return await deleteIssues(context);
Expand Down
2 changes: 1 addition & 1 deletion src/types/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type SupportedEventsU =
| "issue_comment.created"
| "issue_comment.deleted"
| "issue_comment.edited"
| "issues.created"
| "issues.opened"
| "issues.edited"
| "issues.deleted";

Expand Down
6 changes: 3 additions & 3 deletions src/types/typeguards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export function isIssueCommentEvent(context: Context): context is Context<"issue
}

/**
* Restricts the scope of `context` to the `issues.created`, `issues.edited`, and `issues.deleted` payloads.
* Restricts the scope of `context` to the `issues.opened`, `issues.edited`, and `issues.deleted` payloads.
*
* @param context The context object.
*/
export function isIssueEvent(context: Context): context is Context<"issues.created" | "issues.edited" | "issues.deleted"> {
return context.eventName === "issues.created" || context.eventName === "issues.edited" || context.eventName === "issues.deleted";
export function isIssueEvent(context: Context): context is Context<"issues.opened" | "issues.edited" | "issues.deleted"> {
return context.eventName === "issues.opened" || context.eventName === "issues.edited" || context.eventName === "issues.deleted";
}

0 comments on commit 2ea6146

Please sign in to comment.