From ff299be47ca4bf3aa0ce3ad2d5d257acf779ca89 Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Wed, 29 Nov 2023 10:01:46 -0500 Subject: [PATCH] Update main.ts Fixes https://github.com/thollander/actions-comment-pull-request/issues/313 --- src/main.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 62e1ee81..6eb1ec96 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,6 +11,7 @@ async function run() { try { const message: string = core.getInput('message'); const filePath: string = core.getInput('filePath'); + const mdLanguage: string = core.getInput('filePath'); const github_token: string = core.getInput('GITHUB_TOKEN'); const pr_number: string = core.getInput('pr_number'); const comment_tag: string = core.getInput('comment_tag'); @@ -25,7 +26,13 @@ async function run() { let content: string = message; if (!message && filePath) { - content = fs.readFileSync(filePath, 'utf8'); + if (mdLanguage) { + content += "\`\`\`${mdLanguage}\n"; + } + content += fs.readFileSync(filePath, 'utf8'); + if (mdLanguage) { + content += "\n\`\`\`"; + } } const context = github.context;