mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-24 22:58:08 +00:00
fix(website): address review comments on model pages PR
- Fix missing comma in translations.ts (broke build/oxfmt parse) - Fix partner node huggingFaceUrl: use empty string instead of HF homepage - Add rel="noopener noreferrer" to external anchor tags - Remove client:load from ModelHeroSection (presentational, no JS needed) - Fix GH Actions workflow: rename .yml→.yaml, bump to @v6 actions (pinact exempt), pin pnpm action to SHA, fix m.slug→m.suggestedSlug in discovery comparison - Rewrite add-model-page skill to be repo-agnostic (no Glary-Bot references, no hardcoded paths/system assumptions)
This commit is contained in:
@@ -2,7 +2,7 @@ name: Model Page Discovery
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 9 * * 1' # Every Monday at 9am UTC
|
||||
- cron: '0 9 * * 1'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -14,41 +14,27 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout ComfyUI_frontend
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: ComfyUI_frontend
|
||||
|
||||
- name: Checkout workflow_templates
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: Comfy-Org/workflow_templates
|
||||
path: workflow_templates
|
||||
|
||||
- name: Setup Node 20
|
||||
uses: actions/setup-node@v4
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
|
||||
with:
|
||||
version: latest
|
||||
run_install: false
|
||||
|
||||
- name: Get pnpm store directory
|
||||
id: pnpm-cache
|
||||
shell: bash
|
||||
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
||||
working-directory: ComfyUI_frontend
|
||||
|
||||
- name: Cache pnpm store
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('ComfyUI_frontend/**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
working-directory: ComfyUI_frontend
|
||||
@@ -66,26 +52,27 @@ jobs:
|
||||
set -euo pipefail
|
||||
cd ComfyUI_frontend
|
||||
|
||||
# Extract slugs from the generated out.json
|
||||
NEW_SLUGS=$(node -e "
|
||||
const fs = require('fs');
|
||||
const models = JSON.parse(fs.readFileSync('out.json', 'utf8'));
|
||||
const arr = Array.isArray(models) ? models : Object.values(models);
|
||||
const slugs = arr.map(m => m.slug).filter(Boolean);
|
||||
const slugs = arr.map(m => m.suggestedSlug ?? m.slug).filter(Boolean);
|
||||
console.log(JSON.stringify(slugs));
|
||||
")
|
||||
|
||||
# Extract slugs from existing models.ts config
|
||||
EXISTING_SLUGS=$(node -e "
|
||||
const fs = require('fs');
|
||||
const content = fs.readFileSync('apps/website/src/config/models.ts', 'utf8');
|
||||
// Match slug: 'value' or slug: \"value\" patterns
|
||||
const matches = [...content.matchAll(/slug\s*:\s*['\"]([^'\"]+)['\"]/g)];
|
||||
const content = fs.readFileSync(
|
||||
'apps/website/src/config/models.ts',
|
||||
'utf8'
|
||||
);
|
||||
const matches = [
|
||||
...content.matchAll(/slug\s*:\s*['\"]([^'\"]+)['\"]/g)
|
||||
];
|
||||
const slugs = matches.map(m => m[1]);
|
||||
console.log(JSON.stringify(slugs));
|
||||
" 2>/dev/null || echo '[]')
|
||||
|
||||
# Find new slugs not in existing config
|
||||
ADDED_SLUGS=$(node -e "
|
||||
const newSlugs = $NEW_SLUGS;
|
||||
const existing = $EXISTING_SLUGS;
|
||||
@@ -122,7 +109,8 @@ jobs:
|
||||
--title "New models detected — add to model pages" \
|
||||
--body "## $NEW_COUNT new model(s) found in workflow_templates
|
||||
|
||||
The weekly model discovery scan found models present in \`workflow_templates\` that are not yet in \`apps/website/src/config/models.ts\`.
|
||||
The weekly model discovery scan found models not yet in
|
||||
\`apps/website/src/config/models.ts\`.
|
||||
|
||||
### New slugs ($NEW_COUNT)
|
||||
|
||||
@@ -131,11 +119,11 @@ jobs:
|
||||
### Next steps
|
||||
|
||||
1. Review which of these warrant an SEO model page
|
||||
2. Run \`pnpm tsx apps/website/scripts/generate-models.ts\` locally for full details
|
||||
3. Add entries to \`apps/website/src/config/models.ts\` via PR (or use Glary-Bot via Slack)
|
||||
2. Run \`pnpm tsx apps/website/scripts/generate-models.ts\` locally
|
||||
3. Add entries to \`apps/website/src/config/models.ts\` via PR
|
||||
|
||||
---
|
||||
*Generated by the [model-page-discovery workflow](https://github.com/$GITHUB_REPOSITORY/actions/workflows/model-page-discovery.yml)*"
|
||||
*Generated by the [model-page-discovery workflow](https://github.com/$GITHUB_REPOSITORY/actions/workflows/model-page-discovery.yaml)*"
|
||||
|
||||
- name: No new models found
|
||||
if: steps.compare.outputs.new_count == '0'
|
||||
Reference in New Issue
Block a user