Skip to content

Commit 7d95ca3

Browse files
committed
refactor output formatting in analyze, comment, formatting, and testing scripts to use list items for better HTML structure
1 parent 451c9b3 commit 7d95ca3

File tree

6 files changed

+21
-17
lines changed

6 files changed

+21
-17
lines changed

dist/index.js

Lines changed: 10 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/scripts/analyze.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ export const analyze = async (): Promise<stepResponse> => {
1414
for (const { label, command } of results) {
1515
const result = await runCommand(command, label);
1616
if (result) {
17-
commentBody += `${failedEmoji} - ${label}
18-
<details><summary>See details</summary>${result}</details>\n`;
17+
commentBody += `<li>${failedEmoji} - ${label}
18+
<details><summary>See details</summary>${result}</details></li>`;
1919
errorMessages += `${result}\n`;
2020
} else {
21-
commentBody += `${passedEmoji} - ${label}\n`;
21+
commentBody += `<li>${passedEmoji} - ${label}\n</li>`;
2222
}
2323
}
2424

src/scripts/comment.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ export const comment = async (
1313
try {
1414
const commentBody = `
1515
## PR Checks Complete\n
16+
<ul>
1617
${analyzeStr?.output}
1718
${codeFormattingStr?.output}
18-
${testingStr?.output}`;
19+
${testingStr?.output}
20+
</ul>`;
1921
// ## Coverage = ${coverageStr?.output}\n`
2022

2123
const { data: comments } = await ocotokit.rest.issues.listComments({

src/scripts/formatting.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export const formatting = async (): Promise<stepResponse> => {
77
// Run prettier
88
await exec("npm run prettier");
99

10-
return { output: `${passedEmoji} - Formatting`, error: false };
10+
return { output: `<li>${passedEmoji} - Formatting</li>`, error: false };
1111
} catch (error) {
1212
if (error instanceof Error) setFailed(error.message);
13-
return { output: `${failedEmoji} - Formatting`, error: true };
13+
return { output: `<li>${failedEmoji} - Formatting</li>`, error: true };
1414
}
1515
};

src/scripts/testing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export const testing = async (): Promise<stepResponse> => {
1414
for (const { label, command } of results) {
1515
const result = await runCommand(command, label);
1616
if (result) {
17-
commentBody += `${failedEmoji} - ${label}\n`;
17+
commentBody += `<li>${failedEmoji} - ${label}</li>`;
1818
errorMessages += `${result}\n`;
1919
} else {
20-
commentBody += `${passedEmoji} - ${label}\n`;
20+
commentBody += `<li>${passedEmoji} - ${label}</li>`;
2121
}
2222
}
2323

0 commit comments

Comments
 (0)