Skip to content

Commit

Permalink
refactor error handling in analyze.ts, update comment formatting in c…
Browse files Browse the repository at this point in the history
…omment.ts, and remove debug flag from test command in testing.ts
  • Loading branch information
DE7924 committed Dec 12, 2024
1 parent 0a07525 commit 7480713
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/scripts/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ const runCommand = async (
if (error instanceof Error) {
debug(`${label} failed: ${error.message}`);
return error.message;
} else if (typeof error === "string") {
debug(`${label} failed: ${error}`);
return error;
} else {
return true;
}
return true;
}
};

Expand Down
8 changes: 4 additions & 4 deletions src/scripts/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export const comment = async (
): Promise<stepResponse> => {
try {
const commentBody = `
## PR Checks Complete\n
${analyzeStr?.output}\n
${codeFormattingStr?.output}\n
${testingStr?.output}\n`;
## PR Checks Complete\n
${analyzeStr?.output}\n
${codeFormattingStr?.output}\n
${testingStr?.output}\n`;
// ## Coverage = ${coverageStr?.output}\n`

await ocotokit.rest.issues.createComment({
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { stepResponse } from "src/main";
export const testing = async (): Promise<stepResponse> => {
try {
// Run tests and generate coverage
await exec("npm run test -- --coverage --debug");
await exec("npm run test -- --coverage");

// Test tsdoc
await exec("npm run docs");
Expand Down

0 comments on commit 7480713

Please sign in to comment.