mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-14 20:27:42 +01:00
ci(pull-request): Fix generate comments for empty changes (#2593)
This commit is contained in:
0
comment-markup.md
Normal file
0
comment-markup.md
Normal file
@@ -15,11 +15,21 @@ const BASE_URL = 'https://lucide.dev/api/gh-icon';
|
||||
|
||||
const changedFilesPathString = process.env.CHANGED_FILES;
|
||||
|
||||
if (changedFilesPathString == null) {
|
||||
console.error('CHANGED_FILES env variable is not set');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const changedFiles = changedFilesPathString
|
||||
.split(' ')
|
||||
.map((file) => file.replace('.json', '.svg'))
|
||||
.filter((file, idx, arr) => arr.indexOf(file) === idx);
|
||||
|
||||
if (changedFiles.length === 0) {
|
||||
console.log('No changed icons found');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const getImageTagsByFiles = (files, getBaseUrl, width) =>
|
||||
files.map((file) => {
|
||||
const svgContent = fs.readFileSync(path.join(process.cwd(), file), 'utf-8');
|
||||
|
||||
Reference in New Issue
Block a user