Skip to content

Commit

Permalink
bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
DE7924 committed Dec 12, 2024
1 parent dc1834d commit b80379b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
24 changes: 20 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

25 changes: 21 additions & 4 deletions src/scripts/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,33 @@ export const comment = async (
const commentBody = `
## PR Checks Complete\n
${analyzeStr?.output}\n
${codeFormattingStr?.output}\n
${testingStr?.output}\n`;
${codeFormattingStr?.output}
${testingStr?.output}`;
// ## Coverage = ${coverageStr?.output}\n`

await ocotokit.rest.issues.createComment({
const { data: comments } = await ocotokit.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody,
});
const comment = comments.find((comment) =>
comment.body!.includes("PR Checks Complete"),

Check warning on line 27 in src/scripts/comment.ts

View workflow job for this annotation

GitHub Actions / code-quality

Forbidden non-null assertion
);
if (comment) {
await ocotokit.rest.issues.updateComment({
comment_id: comment.id,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody,
});
} else {
await ocotokit.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody,
});
}
return { output: "Comment successful", error: false };
} catch (error) {
if (error instanceof Error) setFailed(error.message);
Expand Down

0 comments on commit b80379b

Please sign in to comment.