Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text setup for the issue comment #166

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}