@@ -3,6 +3,14 @@ import { getOctokit } from "@actions/github";
33import { Context } from "@actions/github/lib/context" ;
44import { failedEmoji , passedEmoji , StepResponse } from "src/main" ;
55
6+ /**
7+ * Generates a formatted message for a group of steps.
8+ *
9+ * @param {string } name - The name of the group.
10+ * @param {StepResponse[] } steps - An array of step responses.
11+ * @param {boolean } showOnPass - A boolean indicating whether to show the message even if all steps pass.
12+ * @returns {string } A formatted string message for the group of steps.
13+ */
614const group = (
715 name : string ,
816 steps : StepResponse [ ] ,
@@ -20,6 +28,12 @@ const group = (
2028 }
2129} ;
2230
31+ /**
32+ * Generates an HTML list item (`<li>`) element containing the provided string.
33+ *
34+ * @param {string } str - The string to be included within the list item.
35+ * @returns {string } The HTML string representing the list item.
36+ */
2337const li = ( str : string ) : string => {
2438 return `
2539<li>
@@ -28,6 +42,25 @@ const li = (str: string): string => {
2842` ;
2943} ;
3044
45+ /**
46+ * Posts a comment on a GitHub issue or pull request summarizing the results of various checks.
47+ * If a comment with the summary already exists, it updates the comment instead.
48+ *
49+ * @param {ReturnType<typeof getOctokit> } ocotokit - The Octokit instance for making GitHub API requests.
50+ * @param {Context } context - The context of the GitHub action, including issue and repository information.
51+ * @param {StepResponse | undefined } npmIStr - The result of the npm install step.
52+ * @param {StepResponse | undefined } cemStr - The result of the custom element manifest step.
53+ * @param {StepResponse | undefined } eslintStr - The result of the ESLint step.
54+ * @param {StepResponse | undefined } litAnalyzerStr - The result of the Lit Analyzer step.
55+ * @param {StepResponse | undefined } prettierStr - The result of the Prettier formatting step.
56+ * @param {StepResponse | undefined } playwrightStr - The result of the Playwright testing step.
57+ * @param {StepResponse | undefined } testingStr - The result of the general testing step.
58+ * @param {StepResponse | undefined } coverageStr - The result of the code coverage step.
59+ * @param {StepResponse | undefined } typeDocStr - The result of the TypeDoc documentation generation step.
60+ * @param {StepResponse | undefined } checkModifiedFilesStr - The result of the check for modified files step.
61+ * @param {StepResponse | undefined } updateChangesStr - The result of the update changes step.
62+ * @returns {Promise<StepResponse> } A promise that resolves to a StepResponse indicating the success or failure of the comment operation.
63+ */
3164export const comment = async (
3265 ocotokit : ReturnType < typeof getOctokit > ,
3366 context : Context ,
0 commit comments