diff --git a/README.md b/README.md index c069342..dec3917 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ For example: `ci/django.yml` and `ci/properties/django.properties.json`. * `name`: the name shown in onboarding. This property is unique within the repository. * `description`: the description shown in onboarding * `iconName`: the icon name in the relevant folder, for example, `django` should have an icon `icons/django.svg`. Only SVG is supported at this time. Another option is to use [octicon](https://primer.style/octicons/). The format to use an octicon is `octicon <>`. Example: `octicon person` + Another option is to use [lucide](https://lucide.dev/icons/). The format to use a lucide icon is `lucide <>`. Example: `lucide bug`. * `creator`: creator of the template shown in onboarding. All the workflow templates from an author will have the same `creator` field. * `categories`: the categories that it will be shown under. Choose at least one category from the list [here](#categories). Further, choose the categories from the list of languages available [here](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml) and the list of tech stacks available [here](https://github.com/github-starter-workflows/repo-analysis-partner/blob/main/tech_stacks.yml). When a user views the available templates, those templates that match the language and tech stacks will feature more prominently. diff --git a/script/sync-ghes/index.ts b/script/sync-ghes/index.ts index 99c746b..8b56c57 100755 --- a/script/sync-ghes/index.ts +++ b/script/sync-ghes/index.ts @@ -189,7 +189,12 @@ async function checkWorkflow( }; if (x.iconType === "svg") { - r.push(join("../../icons", `${x.iconName}.svg`)); + r.push( + join( + "../../icons", + `${x.iconName && x.iconName.startsWith("lucide ") ? `lucide-${x.iconName.slice("lucide ".length).trim()}` : x.iconName}.svg` + ) + ); } return r; diff --git a/script/validate-data/index.ts b/script/validate-data/index.ts index 4bd260d..a3eab9a 100755 --- a/script/validate-data/index.ts +++ b/script/validate-data/index.ts @@ -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 {