Skip to content

Commit

Permalink
chore: trim, remove comment, cspell
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Oct 25, 2024
1 parent 46e0883 commit 8470575
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"nemo",
"Reranking",
"mistralai",
"OPENROUTER_API_KEY"
"OPENROUTER_API_KEY",
"Openrouter"
],
"dictionaries": ["typescript", "node", "software-terms"],
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
Expand Down
5 changes: 4 additions & 1 deletion src/handlers/comment-created-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export async function issueCommentCreatedCallback(
logger,
env: { UBIQUITY_OS_APP_NAME },
} = context;
const question = context.payload.comment.body;
const question = context.payload.comment.body.trim();
if (!question || question.length === 0) {
return { status: 204, reason: logger.info("Comment is empty. Skipping.").logMessage.raw };
}
const slugRegex = new RegExp(`@${UBIQUITY_OS_APP_NAME} `, "gi");
if (!question.match(slugRegex)) {
return { status: 204, reason: logger.info("Comment does not mention the app. Skipping.").logMessage.raw };
Expand Down
2 changes: 0 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// @ts-expect-error - no types found
import * as core from "@actions/core";
// @ts-expect-error - no types found
import * as github from "@actions/github";
import { Value } from "@sinclair/typebox/value";
import { envSchema } from "./types/env";
Expand Down

0 comments on commit 8470575

Please sign in to comment.