From f33728085a2771486f096804c2e8c1a983ec6d2a Mon Sep 17 00:00:00 2001 From: Rob Bos Date: Tue, 12 Dec 2023 11:45:05 +0000 Subject: [PATCH] Fix text setup for the issue comment --- dist/index.js | 20 ++++++++++++-------- src/index.ts | 29 +++++++++++++++++------------ 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/dist/index.js b/dist/index.js index ac3af8d..81ce109 100644 --- a/dist/index.js +++ b/dist/index.js @@ -35089,24 +35089,28 @@ function getCommentBody(largeFiles, accidentallyCheckedInLsfFiles, fsl) { .split(', ') .map(file => `- ${file}`) .join('\n'); + // note: indentation is important here, as it is used to determine the code block const largeFilesBody = `The following file(s) exceeds the file size limit: \`${fsl}\` bytes, as set in the .yml configuration files: - ${largeFilesList} +${largeFilesList} - Consider using \`git-lfs\` to manage large files. - `; +Consider using \`git-lfs\` to manage large files. +`; const accidentalFilesList = accidentallyCheckedInLsfFiles .join(', ') .split(', ') .map(file => `- ${file}`) .join('\n'); + // note: indentation is important here, as it is used to determine the code block const accidentallyCheckedInLsfFilesBody = `The following file(s) are tracked in LFS and were likely accidentally checked in: - ${accidentalFilesList} - `; - const body = `:rotating_light: Possible file(s) that should be tracked in LFS detected: :rotating_light: - ${largeFiles.length > 0 ? largeFilesBody : ''} - ${accidentallyCheckedInLsfFiles.length > 0 + ${accidentalFilesList} +`; + // note: indentation is important here, as it is used to determine the code block + const body = `## Possible file(s) that should be tracked in LFS detected: :rotating_light: + +${largeFiles.length > 0 ? largeFilesBody : ''} +${accidentallyCheckedInLsfFiles.length > 0 ? accidentallyCheckedInLsfFilesBody : ''}`; return body; diff --git a/src/index.ts b/src/index.ts index 944ae93..e39418b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -230,29 +230,34 @@ function getCommentBody( .split(', ') .map(file => `- ${file}`) .join('\n'); + // note: indentation is important here, as it is used to determine the code block const largeFilesBody = `The following file(s) exceeds the file size limit: \`${fsl}\` bytes, as set in the .yml configuration files: - ${largeFilesList} +${largeFilesList} - Consider using \`git-lfs\` to manage large files. - `; +Consider using \`git-lfs\` to manage large files. +`; const accidentalFilesList = accidentallyCheckedInLsfFiles .join(', ') .split(', ') .map(file => `- ${file}`) .join('\n'); + + // note: indentation is important here, as it is used to determine the code block const accidentallyCheckedInLsfFilesBody = `The following file(s) are tracked in LFS and were likely accidentally checked in: - ${accidentalFilesList} - `; + ${accidentalFilesList} +`; + + // note: indentation is important here, as it is used to determine the code block + const body = `## Possible file(s) that should be tracked in LFS detected: :rotating_light: - const body = `:rotating_light: Possible file(s) that should be tracked in LFS detected: :rotating_light: - ${largeFiles.length > 0 ? largeFilesBody : ''} - ${ - accidentallyCheckedInLsfFiles.length > 0 - ? accidentallyCheckedInLsfFilesBody - : '' - }`; +${largeFiles.length > 0 ? largeFilesBody : ''} +${ + accidentallyCheckedInLsfFiles.length > 0 + ? accidentallyCheckedInLsfFilesBody + : '' +}`; return body; }