Add support lucide icons

This commit is contained in:
Mara Nikola Kiefer
2026-04-10 10:20:50 +02:00
parent 0285ae2de7
commit 80143c4da3
3 changed files with 25 additions and 4 deletions
+18 -3
View File
@@ -91,10 +91,25 @@ async function checkWorkflow(workflowPath: string, propertiesPath: string, allow
if (properties.iconName) {
if(! /^octicon\s+/.test(properties.iconName)) {
try {
await fs.access(`../../icons/${properties.iconName}.svg`)
} catch (e) {
let svgIconName: string | undefined = properties.iconName
if (properties.iconName.startsWith("lucide ")) {
const lucideName = properties.iconName.slice("lucide ".length).split(".")[0].trim()
if(!lucideName) {
workflowErrors.errors.push(`No icon named ${properties.iconName} found`)
svgIconName = undefined
} else {
svgIconName = `lucide-${lucideName}`
}
}
if(!svgIconName) {
workflowErrors.errors.push(`No icon named ${properties.iconName} found`)
} else {
try {
await fs.access(`../../icons/${svgIconName}.svg`)
} catch (e) {
workflowErrors.errors.push(`No icon named ${properties.iconName} found`)
}
}
}
else {