Skip to content

Commit

Permalink
comment formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
DE7924 committed Jan 8, 2025
1 parent 7e8adae commit 956fb9f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
23 changes: 12 additions & 11 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.

23 changes: 12 additions & 11 deletions src/scripts/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const group = (
const isError = steps.some((step) => step.error);
let message = "";
if (isError) {
message += ` <details><summary>${failedEmoji} - ${name}</summary>`;
message += `<details><summary>${failedEmoji} - ${name}</summary>`;
for (const step in steps) {
message += `${steps[step].output}\n`;
message += ` ${steps[step].output}\n`;
}
message += ` </details>`;
message += `</details>`;
} else if (showOnPass) {
message = `${passedEmoji} - ${name}\n`;
message = ` ${passedEmoji} - ${name}\n`;
} else {
message = "";
}
Expand All @@ -27,9 +27,11 @@ const group = (

const li = (str: string): string => {
return `
<li>
${str}
</li>
`;
};

Expand Down Expand Up @@ -79,13 +81,12 @@ export const comment = async (
// ${updateChangesStr !== undefined ? li(updateChangesStr.output) : ""}
const commentBody = `
## PR Checks Complete\n
<ul style="list-style-type:none;">
${li(group("Setup", setup, false))}
${li(group("Analysis", analysis, true))}
${li(group("Formatting", formatting, true))}
${li(group("Testing", testing, true))}
${li(group("Post Checks", postChecks, false))}
</ul>`;
${group("Setup", setup, false)}
${group("Analysis", analysis, true)}
${group("Formatting", formatting, true)}
${group("Testing", testing, true)}
${group("Post Checks", postChecks, false)}
`;

const { data: comments } = await ocotokit.rest.issues.listComments({
issue_number: context.issue.number,
Expand Down

0 comments on commit 956fb9f

Please sign in to comment.