Skip to content

Commit

Permalink
Fix text setup for the issue comment (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajbos committed Dec 12, 2023
1 parent f6cd442 commit 46bc818
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
20 changes: 12 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
29 changes: 17 additions & 12 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 46bc818

Please sign in to comment.