Skip to content

Commit 1059637

Browse files
committed
refactor: streamline TypeDoc integration and enhance comment formatting
1 parent 069e92a commit 1059637

File tree

7 files changed

+243
-151
lines changed

7 files changed

+243
-151
lines changed

dist/index.js

Lines changed: 122 additions & 75 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/main.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { getBooleanInput, getInput, setFailed } from "@actions/core";
22
import { exec } from "@actions/exec";
33
import { getOctokit, context } from "@actions/github";
4-
import { eslint, litAnalyzer } from "./scripts/analyze";
5-
import { playwright, testing, typeDoc } from "./scripts/testing";
4+
import { eslint, litAnalyzer, typeDoc } from "./scripts/analyze";
5+
import { playwright, testing } from "./scripts/testing";
66
import { coverage, getCoverage } from "./scripts/coverage";
77
import { comment } from "./scripts/comment";
88
import { cwd, chdir } from "process";
@@ -71,11 +71,17 @@ export const buildComment = async (
7171
): Promise<StepResponse> => {
7272
if (response.error == true) {
7373
if (problemsCount !== undefined && problemsCount > 0) {
74-
response.output = `${failedEmoji} - ${label}: ${problemsCount} problem${
74+
// response.output = `${failedEmoji} - ${label}: ${problemsCount} problem${
75+
// problemsCount > 1 ? "s" : ""
76+
// } found\n<details><summary>See Details</summary>${outputStr}</details>`;
77+
78+
response.output = `${failedEmoji} - <details><summary>${label}: ${problemsCount} problem${
7579
problemsCount > 1 ? "s" : ""
76-
} found\n<details><summary>See Details</summary>${outputStr}</details>`;
80+
}</summary>${outputStr}</details>\n`;
7781
} else {
78-
response.output = `${failedEmoji} - ${label}\n<details><summary>See Details</summary>${outputStr}</details>`;
82+
// response.output = `${failedEmoji} - ${label}\n<details><summary>See Details</summary>${outputStr}</details>`;
83+
84+
response.output = `${failedEmoji} - <details><summary>${label}</summary>${outputStr}</details>\n`;
7985
}
8086
} else {
8187
response.output = `${passedEmoji} - ${label}\n`;
@@ -234,6 +240,13 @@ export async function run(): Promise<void> {
234240
})
235241
: undefined;
236242

243+
const typeDocStr: StepResponse | undefined = doStaticAnalysis
244+
? await typeDoc({
245+
label: "TypeDoc",
246+
command: "npx typedoc --logLevel Warn",
247+
})
248+
: undefined;
249+
237250
let webComponentsSrcRoot = wcSrcDirectory.split("/").shift();
238251
if (webComponentsSrcRoot?.isEmpty()) {
239252
webComponentsSrcRoot = wcSrcDirectory.split("/")[1];
@@ -287,13 +300,6 @@ export async function run(): Promise<void> {
287300
)
288301
: undefined;
289302

290-
const typeDocStr: StepResponse | undefined = doTests
291-
? await typeDoc({
292-
label: "TypeDoc",
293-
command: "npx typedoc --logLevel Warn",
294-
})
295-
: undefined;
296-
297303
const [checkModifiedFilesStr, modified]: [StepResponse, boolean] =
298304
await checkModifiedFiles({
299305
label: "Check for modified files",

0 commit comments

Comments
 (0)