Skip to content

Commit d30698c

Browse files
authored
ci(pull-request): Fix generate comments for empty changes (#2593)
1 parent d2f7a09 commit d30698c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

comment-markup.md

Whitespace-only changes.

scripts/generateChangedIconsCommentMarkup.mjs

+10
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,21 @@ const BASE_URL = 'https://lucide.dev/api/gh-icon';
1515

1616
const changedFilesPathString = process.env.CHANGED_FILES;
1717

18+
if (changedFilesPathString == null) {
19+
console.error('CHANGED_FILES env variable is not set');
20+
process.exit(1);
21+
}
22+
1823
const changedFiles = changedFilesPathString
1924
.split(' ')
2025
.map((file) => file.replace('.json', '.svg'))
2126
.filter((file, idx, arr) => arr.indexOf(file) === idx);
2227

28+
if (changedFiles.length === 0) {
29+
console.log('No changed icons found');
30+
process.exit(0);
31+
}
32+
2333
const getImageTagsByFiles = (files, getBaseUrl, width) =>
2434
files.map((file) => {
2535
const svgContent = fs.readFileSync(path.join(process.cwd(), file), 'utf-8');

0 commit comments

Comments
 (0)