From 83e6e14ae1e7f27056c840282d225accb05dff9e Mon Sep 17 00:00:00 2001 From: Mentlegen <9807008+gentlementlegen@users.noreply.github.com> Date: Wed, 10 Jul 2024 13:00:41 +0900 Subject: [PATCH] chore: sorting commands --- src/github/handlers/issue-comment-created.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/github/handlers/issue-comment-created.ts b/src/github/handlers/issue-comment-created.ts index 86be030..e7d41cd 100644 --- a/src/github/handlers/issue-comment-created.ts +++ b/src/github/handlers/issue-comment-created.ts @@ -23,6 +23,7 @@ export default async function issueCommentCreated(context: GitHubContext<"issue_ "|---|---|---|", "| `/help` | List all available commands. | `/help` |", ]; + const commands: string[] = []; const configuration = await getConfig(context); for (const pluginArray of Object.values(configuration.plugins)) { for (const pluginElement of pluginArray) { @@ -30,13 +31,13 @@ export default async function issueCommentCreated(context: GitHubContext<"issue_ const manifest = await (isGithubPlugin(plugin) ? fetchActionManifest(context, plugin) : fetchWorkerManifest(plugin)); if (manifest?.commands) { for (const command of manifest.commands) { - comments.push(`| \`${getContent(command.command)}\` | ${getContent(command.description)} | \`${getContent(command.example)}\` |`); + commands.push(`| \`${getContent(command.command)}\` | ${getContent(command.description)} | \`${getContent(command.example)}\` |`); } } } } await context.octokit.issues.createComment({ - body: comments.sort().join("\n"), + body: comments.concat(commands.sort()).join("\n"), issue_number: context.payload.issue.number, owner: context.payload.repository.owner.login, repo: context.payload.repository.name,