ci: add yamllint (#6682)

adds yaml linting to CI and applies rules to existing yaml files.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6682-ci-add-yamllint-2aa6d73d365081b4b67ae9d9cc86760f)
by [Unito](https://www.unito.io)
This commit is contained in:
Christian Byrne
2025-11-13 10:10:48 -08:00
committed by GitHub
parent 63ca4a3779
commit 5e4965d131
17 changed files with 293 additions and 237 deletions

View File

@@ -36,9 +36,9 @@ body:
3. Click Queue Prompt 3. Click Queue Prompt
4. See error 4. See error
value: | value: |
1. 1.
2. 2.
3. 3.
validations: validations:
required: true required: true

View File

@@ -105,4 +105,4 @@ jobs:
labels: Manager labels: Manager
delete-branch: true delete-branch: true
add-paths: | add-paths: |
src/types/generatedManagerTypes.ts src/types/generatedManagerTypes.ts

View File

@@ -51,7 +51,7 @@ jobs:
if [ -n "$(git status --porcelain)" ]; then if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT echo "changed=true" >> $GITHUB_OUTPUT
else else
echo "changed=false" >> $GITHUB_OUTPUT echo "changed=false" >> $GITHUB_OUTPUT
fi fi
- name: Commit changes - name: Commit changes

View File

@@ -6,7 +6,7 @@ on:
paths: paths:
- 'tools/devtools/**' - 'tools/devtools/**'
push: push:
branches: [ main ] branches: [main]
paths: paths:
- 'tools/devtools/**' - 'tools/devtools/**'

View File

@@ -13,7 +13,7 @@ jobs:
deploy-and-comment-forked-pr: deploy-and-comment-forked-pr:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: | if: |
github.repository == 'Comfy-Org/ComfyUI_frontend' && github.repository == 'Comfy-Org/ComfyUI_frontend' &&
github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.head_repository != null && github.event.workflow_run.head_repository != null &&
github.event.workflow_run.repository != null && github.event.workflow_run.repository != null &&
@@ -43,14 +43,14 @@ jobs:
repo: context.repo.repo, repo: context.repo.repo,
state: 'open', state: 'open',
}); });
const pr = prs.find(p => p.head.sha === context.payload.workflow_run.head_sha); const pr = prs.find(p => p.head.sha === context.payload.workflow_run.head_sha);
if (!pr) { if (!pr) {
console.log('No PR found for SHA:', context.payload.workflow_run.head_sha); console.log('No PR found for SHA:', context.payload.workflow_run.head_sha);
return null; return null;
} }
console.log(`Found PR #${pr.number} from fork: ${context.payload.workflow_run.head_repository.full_name}`); console.log(`Found PR #${pr.number} from fork: ${context.payload.workflow_run.head_repository.full_name}`);
return pr.number; return pr.number;
@@ -74,7 +74,7 @@ jobs:
run-id: ${{ github.event.workflow_run.id }} run-id: ${{ github.event.workflow_run.id }}
pattern: playwright-report-* pattern: playwright-report-*
path: reports path: reports
- name: Handle Test Completion - name: Handle Test Completion
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed' if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
env: env:
@@ -85,9 +85,9 @@ jobs:
# Rename merged report if exists # Rename merged report if exists
[ -d "reports/playwright-report-chromium-merged" ] && \ [ -d "reports/playwright-report-chromium-merged" ] && \
mv reports/playwright-report-chromium-merged reports/playwright-report-chromium mv reports/playwright-report-chromium-merged reports/playwright-report-chromium
chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
./scripts/cicd/pr-playwright-deploy-and-comment.sh \ ./scripts/cicd/pr-playwright-deploy-and-comment.sh \
"${{ steps.pr.outputs.result }}" \ "${{ steps.pr.outputs.result }}" \
"${{ github.event.workflow_run.head_branch }}" \ "${{ github.event.workflow_run.head_branch }}" \
"completed" "completed"

View File

@@ -29,7 +29,7 @@ jobs:
with: with:
include_build_step: true include_build_step: true
- name: Setup Playwright - name: Setup Playwright
uses: ./.github/actions/setup-playwright # Setup Playwright and cache browsers uses: ./.github/actions/setup-playwright # Setup Playwright and cache browsers
# Save the entire workspace as cache for later test jobs to restore # Save the entire workspace as cache for later test jobs to restore
- name: Generate cache key - name: Generate cache key

View File

@@ -13,7 +13,7 @@ jobs:
deploy-and-comment-forked-pr: deploy-and-comment-forked-pr:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: | if: |
github.repository == 'Comfy-Org/ComfyUI_frontend' && github.repository == 'Comfy-Org/ComfyUI_frontend' &&
github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.head_repository != null && github.event.workflow_run.head_repository != null &&
github.event.workflow_run.repository != null && github.event.workflow_run.repository != null &&
@@ -43,14 +43,14 @@ jobs:
repo: context.repo.repo, repo: context.repo.repo,
state: 'open', state: 'open',
}); });
const pr = prs.find(p => p.head.sha === context.payload.workflow_run.head_sha); const pr = prs.find(p => p.head.sha === context.payload.workflow_run.head_sha);
if (!pr) { if (!pr) {
console.log('No PR found for SHA:', context.payload.workflow_run.head_sha); console.log('No PR found for SHA:', context.payload.workflow_run.head_sha);
return null; return null;
} }
console.log(`Found PR #${pr.number} from fork: ${context.payload.workflow_run.head_repository.full_name}`); console.log(`Found PR #${pr.number} from fork: ${context.payload.workflow_run.head_repository.full_name}`);
return pr.number; return pr.number;
@@ -74,7 +74,7 @@ jobs:
run-id: ${{ github.event.workflow_run.id }} run-id: ${{ github.event.workflow_run.id }}
name: storybook-static name: storybook-static
path: storybook-static path: storybook-static
- name: Handle Storybook Completion - name: Handle Storybook Completion
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed' if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
env: env:
@@ -88,4 +88,4 @@ jobs:
./scripts/cicd/pr-storybook-deploy-and-comment.sh \ ./scripts/cicd/pr-storybook-deploy-and-comment.sh \
"${{ steps.pr.outputs.result }}" \ "${{ steps.pr.outputs.result }}" \
"${{ github.event.workflow_run.head_branch }}" \ "${{ github.event.workflow_run.head_branch }}" \
"completed" "completed"

View File

@@ -2,7 +2,7 @@ name: "CI: Tests Storybook"
description: "Builds Storybook and runs visual regression testing via Chromatic, deploys previews to Cloudflare Pages" description: "Builds Storybook and runs visual regression testing via Chromatic, deploys previews to Cloudflare Pages"
on: on:
workflow_dispatch: # Allow manual triggering workflow_dispatch: # Allow manual triggering
pull_request: pull_request:
branches: [main] branches: [main]
@@ -16,7 +16,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v5 uses: actions/checkout@v5
- name: Post starting comment - name: Post starting comment
env: env:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
@@ -89,7 +89,7 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 0 # Required for Chromatic baseline fetch-depth: 0 # Required for Chromatic baseline
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
@@ -111,9 +111,9 @@ jobs:
with: with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: build-storybook buildScriptName: build-storybook
autoAcceptChanges: 'main' # Auto-accept changes on main branch autoAcceptChanges: 'main' # Auto-accept changes on main branch
exitOnceUploaded: true # Don't wait for UI tests to complete exitOnceUploaded: true # Don't wait for UI tests to complete
onlyChanged: true # Only capture changed stories onlyChanged: true # Only capture changed stories
- name: Set job status - name: Set job status
id: job-status id: job-status
@@ -138,17 +138,17 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v5 uses: actions/checkout@v5
- name: Download Storybook build - name: Download Storybook build
if: needs.storybook-build.outputs.conclusion == 'success' if: needs.storybook-build.outputs.conclusion == 'success'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: storybook-static name: storybook-static
path: storybook-static path: storybook-static
- name: Make deployment script executable - name: Make deployment script executable
run: chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh run: chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh
- name: Deploy Storybook and comment on PR - name: Deploy Storybook and comment on PR
env: env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@@ -176,25 +176,25 @@ jobs:
script: | script: |
const buildUrl = '${{ needs.chromatic-deployment.outputs.chromatic-build-url }}'; const buildUrl = '${{ needs.chromatic-deployment.outputs.chromatic-build-url }}';
const storybookUrl = '${{ needs.chromatic-deployment.outputs.chromatic-storybook-url }}'; const storybookUrl = '${{ needs.chromatic-deployment.outputs.chromatic-storybook-url }}';
// Find the existing Storybook comment // Find the existing Storybook comment
const { data: comments } = await github.rest.issues.listComments({ const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
issue_number: ${{ github.event.pull_request.number }} issue_number: ${{ github.event.pull_request.number }}
}); });
const storybookComment = comments.find(comment => const storybookComment = comments.find(comment =>
comment.body.includes('<!-- STORYBOOK_BUILD_STATUS -->') comment.body.includes('<!-- STORYBOOK_BUILD_STATUS -->')
); );
if (storybookComment && buildUrl && storybookUrl) { if (storybookComment && buildUrl && storybookUrl) {
// Append Chromatic info to existing comment // Append Chromatic info to existing comment
const updatedBody = storybookComment.body.replace( const updatedBody = storybookComment.body.replace(
/---\n(.*)$/s, /---\n(.*)$/s,
`---\n### 🎨 Chromatic Visual Tests\n- 📊 [View Chromatic Build](${buildUrl})\n- 📚 [View Chromatic Storybook](${storybookUrl})\n\n$1` `---\n### 🎨 Chromatic Visual Tests\n- 📊 [View Chromatic Build](${buildUrl})\n- 📚 [View Chromatic Storybook](${storybookUrl})\n\n$1`
); );
await github.rest.issues.updateComment({ await github.rest.issues.updateComment({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,

View File

@@ -0,0 +1,33 @@
name: "CI: YAML Validation"
description: "Validates YAML syntax and style using yamllint with relaxed rules"
on:
push:
branches:
- main
paths:
- '**/*.yml'
- '**/*.yaml'
pull_request:
paths:
- '**/*.yml'
- '**/*.yaml'
jobs:
yaml-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install yamllint
run: |
python -m pip install --upgrade pip
python -m pip install yamllint
- name: Validate YAML syntax and style
run: ./scripts/cicd/check-yaml.sh

View File

@@ -2,11 +2,11 @@ name: "i18n: Update Core"
description: "Generates and updates translations for core ComfyUI components using OpenAI" description: "Generates and updates translations for core ComfyUI components using OpenAI"
on: on:
# Manual dispatch for urgent translation updates # Manual dispatch for urgent translation updates
workflow_dispatch: workflow_dispatch:
# Only trigger on PRs to main/master - additional branch filtering in job condition # Only trigger on PRs to main/master - additional branch filtering in job condition
pull_request: pull_request:
branches: [ main ] branches: [main]
types: [opened, synchronize, reopened] types: [opened, synchronize, reopened]
jobs: jobs:
@@ -15,45 +15,45 @@ jobs:
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-')) if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v5 uses: actions/checkout@v5
# Setup playwright environment # Setup playwright environment
- name: Setup ComfyUI Frontend - name: Setup ComfyUI Frontend
uses: ./.github/actions/setup-frontend uses: ./.github/actions/setup-frontend
with: with:
include_build_step: true include_build_step: true
- name: Setup ComfyUI Server - name: Setup ComfyUI Server
uses: ./.github/actions/setup-comfyui-server uses: ./.github/actions/setup-comfyui-server
with: with:
launch_server: true launch_server: true
- name: Setup Playwright - name: Setup Playwright
uses: ./.github/actions/setup-playwright uses: ./.github/actions/setup-playwright
- name: Start dev server - name: Start dev server
# Run electron dev server as it is a superset of the web dev server # Run electron dev server as it is a superset of the web dev server
# We do want electron specific UIs to be translated. # We do want electron specific UIs to be translated.
run: pnpm dev:electron & run: pnpm dev:electron &
# Update locales, collect new strings and update translations using OpenAI, then commit changes # Update locales, collect new strings and update translations using OpenAI, then commit changes
- name: Update en.json - name: Update en.json
run: pnpm collect-i18n run: pnpm collect-i18n
env: env:
PLAYWRIGHT_TEST_URL: http://localhost:5173 PLAYWRIGHT_TEST_URL: http://localhost:5173
- name: Update translations - name: Update translations
run: pnpm locale run: pnpm locale
env: env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Commit updated locales - name: Commit updated locales
run: | run: |
git config --global user.name 'github-actions' git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com' git config --global user.email 'github-actions@github.com'
git fetch origin ${{ github.head_ref }} git fetch origin ${{ github.head_ref }}
# Stash any local changes before checkout # Stash any local changes before checkout
git stash -u git stash -u
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }} git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
# Apply the stashed changes if any # Apply the stashed changes if any
git stash pop || true git stash pop || true
git add src/locales/ git add src/locales/
git diff --staged --quiet || git commit -m "Update locales" git diff --staged --quiet || git commit -m "Update locales"
git push origin HEAD:${{ github.head_ref }} git push origin HEAD:${{ github.head_ref }}

View File

@@ -21,116 +21,116 @@ jobs:
update-locales: update-locales:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v5 uses: actions/checkout@v5
# Setup playwright environment with custom node repository # Setup playwright environment with custom node repository
- name: Setup ComfyUI Server (without launching) - name: Setup ComfyUI Server (without launching)
uses: ./.github/actions/setup-comfyui-server uses: ./.github/actions/setup-comfyui-server
- name: Setup frontend - name: Setup frontend
uses: ./.github/actions/setup-frontend uses: ./.github/actions/setup-frontend
with: with:
include_build_step: 'true' include_build_step: 'true'
- name: Setup Playwright - name: Setup Playwright
uses: ./.github/actions/setup-playwright uses: ./.github/actions/setup-playwright
# Install the custom node repository # Install the custom node repository
- name: Checkout custom node repository - name: Checkout custom node repository
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
repository: ${{ inputs.owner }}/${{ inputs.repository }} repository: ${{ inputs.owner }}/${{ inputs.repository }}
path: 'ComfyUI/custom_nodes/${{ inputs.repository }}' path: 'ComfyUI/custom_nodes/${{ inputs.repository }}'
- name: Install custom node Python requirements - name: Install custom node Python requirements
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }} working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
run: | run: |
if [ -f "requirements.txt" ]; then if [ -f "requirements.txt" ]; then
pip install -r requirements.txt pip install -r requirements.txt
fi fi
# Start ComfyUI Server # Start ComfyUI Server
- name: Start ComfyUI Server - name: Start ComfyUI Server
shell: bash shell: bash
working-directory: ComfyUI working-directory: ComfyUI
run: | run: |
python main.py --cpu --multi-user --front-end-root ../dist --custom-node-path ../ComfyUI/custom_nodes/${{ inputs.repository }} & python main.py --cpu --multi-user --front-end-root ../dist --custom-node-path ../ComfyUI/custom_nodes/${{ inputs.repository }} &
wait-for-it --service wait-for-it --service
- name: Start dev server - name: Start dev server
# Run electron dev server as it is a superset of the web dev server # Run electron dev server as it is a superset of the web dev server
# We do want electron specific UIs to be translated. # We do want electron specific UIs to be translated.
run: pnpm dev:electron & run: pnpm dev:electron &
- name: Capture base i18n
run: pnpm exec tsx scripts/diff-i18n capture
- name: Update en.json
run: pnpm collect-i18n
env:
PLAYWRIGHT_TEST_URL: http://localhost:5173
- name: Update translations
run: pnpm locale
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Diff base vs updated i18n
run: pnpm exec tsx scripts/diff-i18n diff
- name: Update i18n in custom node repository
run: |
LOCALE_DIR=ComfyUI/custom_nodes/${{ inputs.repository }}/locales/
install -d "$LOCALE_DIR"
cp -rf ComfyUI_frontend/temp/diff/* "$LOCALE_DIR"
# Git ops for pushing changes and creating PR
- name: Check and create fork of custom node repository
run: |
# Try to fork the repository
gh repo fork ${{ inputs.owner }}/${{ inputs.repository }} --clone=false || {
echo "Fork failed - repository might already be forked"
# Exit 0 to prevent the workflow from failing
exit 0
}
# Enable workflows on the forked repository - name: Capture base i18n
gh api \ run: pnpm exec tsx scripts/diff-i18n capture
--method PUT \ - name: Update en.json
-H "Accept: application/vnd.github+json" \ run: pnpm collect-i18n
"/repos/${{ inputs.fork_owner }}/${{ inputs.repository }}/actions/permissions/workflow" \ env:
-F can_approve_pull_request_reviews=true \ PLAYWRIGHT_TEST_URL: http://localhost:5173
-F default_workflow_permissions="write" \ - name: Update translations
-F enabled=true run: pnpm locale
env: env:
GH_TOKEN: ${{ secrets.PR_GH_TOKEN }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Diff base vs updated i18n
run: pnpm exec tsx scripts/diff-i18n diff
- name: Update i18n in custom node repository
run: |
LOCALE_DIR=ComfyUI/custom_nodes/${{ inputs.repository }}/locales/
install -d "$LOCALE_DIR"
cp -rf ComfyUI_frontend/temp/diff/* "$LOCALE_DIR"
- name: Commit changes # Git ops for pushing changes and creating PR
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }} - name: Check and create fork of custom node repository
run: | run: |
git config --global user.name 'github-actions' # Try to fork the repository
git config --global user.email 'github-actions@github.com' gh repo fork ${{ inputs.owner }}/${{ inputs.repository }} --clone=false || {
echo "Fork failed - repository might already be forked"
# Exit 0 to prevent the workflow from failing
exit 0
}
# Create and switch to new branch # Enable workflows on the forked repository
git checkout -b update-locales gh api \
--method PUT \
-H "Accept: application/vnd.github+json" \
"/repos/${{ inputs.fork_owner }}/${{ inputs.repository }}/actions/permissions/workflow" \
-F can_approve_pull_request_reviews=true \
-F default_workflow_permissions="write" \
-F enabled=true
env:
GH_TOKEN: ${{ secrets.PR_GH_TOKEN }}
# Stage and commit changes - name: Commit changes
git add -A working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
git commit -m "Update locales" run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
- name: Install SSH key For PUSH # Create and switch to new branch
uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 git checkout -b update-locales
with:
# PR private key from action server
key: ${{ secrets.PR_SSH_PRIVATE_KEY }}
# github public key to confirm it's github server
known_hosts: github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
- name: Push changes # Stage and commit changes
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }} git add -A
run: | git commit -m "Update locales"
# Force push to create the branch
echo "Pushing changes to ${{ inputs.fork_owner }}/${{ inputs.repository }}"
git push -f git@github.com:${{ inputs.fork_owner }}/${{ inputs.repository }}.git update-locales
- name: Create PR - name: Install SSH key For PUSH
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }} uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4
run: | with:
# Create PR using gh cli # PR private key from action server
gh pr create --title "Update locales for ${{ inputs.repository }}" --repo ${{ inputs.owner }}/${{ inputs.repository }} --head ${{ inputs.fork_owner }}:update-locales --body "Update locales for ${{ inputs.repository }}" key: ${{ secrets.PR_SSH_PRIVATE_KEY }}
env: # github public key to confirm it's github server
GH_TOKEN: ${{ secrets.PR_GH_TOKEN }} known_hosts: github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
- name: Push changes
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
run: |
# Force push to create the branch
echo "Pushing changes to ${{ inputs.fork_owner }}/${{ inputs.repository }}"
git push -f git@github.com:${{ inputs.fork_owner }}/${{ inputs.repository }}.git update-locales
- name: Create PR
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
run: |
# Create PR using gh cli
gh pr create --title "Update locales for ${{ inputs.repository }}" --repo ${{ inputs.owner }}/${{ inputs.repository }} --head ${{ inputs.fork_owner }}:update-locales --body "Update locales for ${{ inputs.repository }}"
env:
GH_TOKEN: ${{ secrets.PR_GH_TOKEN }}

View File

@@ -13,42 +13,42 @@ jobs:
update-locales: update-locales:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v5 uses: actions/checkout@v5
# Setup playwright environment # Setup playwright environment
- name: Setup ComfyUI Server (and start) - name: Setup ComfyUI Server (and start)
uses: ./.github/actions/setup-comfyui-server uses: ./.github/actions/setup-comfyui-server
with: with:
launch_server: true launch_server: true
- name: Setup frontend - name: Setup frontend
uses: ./.github/actions/setup-frontend uses: ./.github/actions/setup-frontend
with: with:
include_build_step: true include_build_step: true
- name: Setup Playwright - name: Setup Playwright
uses: ./.github/actions/setup-playwright uses: ./.github/actions/setup-playwright
- name: Start dev server - name: Start dev server
# Run electron dev server as it is a superset of the web dev server # Run electron dev server as it is a superset of the web dev server
# We do want electron specific UIs to be translated. # We do want electron specific UIs to be translated.
run: pnpm dev:electron & run: pnpm dev:electron &
- name: Update en.json - name: Update en.json
run: pnpm collect-i18n -- scripts/collect-i18n-node-defs.ts run: pnpm collect-i18n -- scripts/collect-i18n-node-defs.ts
env: env:
PLAYWRIGHT_TEST_URL: http://localhost:5173 PLAYWRIGHT_TEST_URL: http://localhost:5173
- name: Update translations - name: Update translations
run: pnpm locale run: pnpm locale
env: env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
with: with:
token: ${{ secrets.PR_GH_TOKEN }} token: ${{ secrets.PR_GH_TOKEN }}
commit-message: "Update locales for node definitions" commit-message: "Update locales for node definitions"
title: "Update locales for node definitions" title: "Update locales for node definitions"
body: | body: |
Automated PR to update locales for node definitions Automated PR to update locales for node definitions
This PR was created automatically by the frontend update workflow. This PR was created automatically by the frontend update workflow.
branch: update-locales-node-defs-${{ github.event.inputs.trigger_type }}-${{ github.run_id }} branch: update-locales-node-defs-${{ github.event.inputs.trigger_type }}-${{ github.run_id }}
base: main base: main
labels: dependencies labels: dependencies

View File

@@ -19,8 +19,8 @@ on:
jobs: jobs:
backport: backport:
if: > if: >
(github.event_name == 'pull_request_target' && (github.event_name == 'pull_request_target' &&
github.event.pull_request.merged == true && github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'needs-backport')) || contains(github.event.pull_request.labels.*.name, 'needs-backport')) ||
github.event_name == 'workflow_dispatch' github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -38,19 +38,19 @@ jobs:
echo "::error::Invalid PR number format. Must be a positive integer." echo "::error::Invalid PR number format. Must be a positive integer."
exit 1 exit 1
fi fi
# Validate PR exists and is merged # Validate PR exists and is merged
if ! gh pr view "${{ inputs.pr_number }}" --json merged >/dev/null 2>&1; then if ! gh pr view "${{ inputs.pr_number }}" --json merged >/dev/null 2>&1; then
echo "::error::PR #${{ inputs.pr_number }} not found or inaccessible." echo "::error::PR #${{ inputs.pr_number }} not found or inaccessible."
exit 1 exit 1
fi fi
MERGED=$(gh pr view "${{ inputs.pr_number }}" --json merged --jq '.merged') MERGED=$(gh pr view "${{ inputs.pr_number }}" --json merged --jq '.merged')
if [ "$MERGED" != "true" ]; then if [ "$MERGED" != "true" ]; then
echo "::error::PR #${{ inputs.pr_number }} is not merged. Only merged PRs can be backported." echo "::error::PR #${{ inputs.pr_number }} is not merged. Only merged PRs can be backported."
exit 1 exit 1
fi fi
# Validate PR has needs-backport label # Validate PR has needs-backport label
if ! gh pr view "${{ inputs.pr_number }}" --json labels --jq '.labels[].name' | grep -q "needs-backport"; then if ! gh pr view "${{ inputs.pr_number }}" --json labels --jq '.labels[].name' | grep -q "needs-backport"; then
echo "::error::PR #${{ inputs.pr_number }} does not have 'needs-backport' label." echo "::error::PR #${{ inputs.pr_number }} does not have 'needs-backport' label."
@@ -330,7 +330,7 @@ jobs:
PR_TITLE="${{ github.event.pull_request.title }}" PR_TITLE="${{ github.event.pull_request.title }}"
PR_AUTHOR="${{ github.event.pull_request.user.login }}" PR_AUTHOR="${{ github.event.pull_request.user.login }}"
fi fi
for backport in ${{ steps.backport.outputs.success }}; do for backport in ${{ steps.backport.outputs.success }}; do
IFS=':' read -r target branch <<< "${backport}" IFS=':' read -r target branch <<< "${backport}"

View File

@@ -127,26 +127,26 @@ jobs:
echo "==========================================" echo "=========================================="
echo "STAGING CHANGED SNAPSHOTS (Shard ${{ matrix.shardIndex }})" echo "STAGING CHANGED SNAPSHOTS (Shard ${{ matrix.shardIndex }})"
echo "==========================================" echo "=========================================="
# Get list of changed snapshot files # Get list of changed snapshot files
changed_files=$(git diff --name-only browser_tests/ 2>/dev/null | grep -E '\-snapshots/' || echo "") changed_files=$(git diff --name-only browser_tests/ 2>/dev/null | grep -E '\-snapshots/' || echo "")
if [ -z "$changed_files" ]; then if [ -z "$changed_files" ]; then
echo "No snapshot changes in this shard" echo "No snapshot changes in this shard"
echo "has-changes=false" >> $GITHUB_OUTPUT echo "has-changes=false" >> $GITHUB_OUTPUT
exit 0 exit 0
fi fi
echo "✓ Found changed files:" echo "✓ Found changed files:"
echo "$changed_files" echo "$changed_files"
file_count=$(echo "$changed_files" | wc -l) file_count=$(echo "$changed_files" | wc -l)
echo "Count: $file_count" echo "Count: $file_count"
echo "has-changes=true" >> $GITHUB_OUTPUT echo "has-changes=true" >> $GITHUB_OUTPUT
echo "" echo ""
# Create staging directory # Create staging directory
mkdir -p /tmp/changed_snapshots_shard mkdir -p /tmp/changed_snapshots_shard
# Copy only changed files, preserving directory structure # Copy only changed files, preserving directory structure
# Strip 'browser_tests/' prefix to avoid double nesting # Strip 'browser_tests/' prefix to avoid double nesting
echo "Copying changed files to staging directory..." echo "Copying changed files to staging directory..."
@@ -159,7 +159,7 @@ jobs:
cp "$file" "/tmp/changed_snapshots_shard/$file_without_prefix" cp "$file" "/tmp/changed_snapshots_shard/$file_without_prefix"
echo " → $file_without_prefix" echo " → $file_without_prefix"
done <<< "$changed_files" done <<< "$changed_files"
echo "" echo ""
echo "Staged files for upload:" echo "Staged files for upload:"
find /tmp/changed_snapshots_shard -type f find /tmp/changed_snapshots_shard -type f
@@ -233,18 +233,18 @@ jobs:
shard_name=$(basename "$shard_dir") shard_name=$(basename "$shard_dir")
file_count=$(find "$shard_dir" -type f | wc -l) file_count=$(find "$shard_dir" -type f | wc -l)
if [ "$file_count" -eq 0 ]; then if [ "$file_count" -eq 0 ]; then
echo " $shard_name: no files" echo " $shard_name: no files"
continue continue
fi fi
echo "Processing $shard_name ($file_count file(s))..." echo "Processing $shard_name ($file_count file(s))..."
# Copy files directly, preserving directory structure # Copy files directly, preserving directory structure
# Since files are already in correct structure (no browser_tests/ prefix), just copy them all # Since files are already in correct structure (no browser_tests/ prefix), just copy them all
cp -v -r "$shard_dir"* browser_tests/ 2>&1 | sed 's/^/ /' cp -v -r "$shard_dir"* browser_tests/ 2>&1 | sed 's/^/ /'
merged_count=$((merged_count + 1)) merged_count=$((merged_count + 1))
echo " ✓ Merged" echo " ✓ Merged"
echo "" echo ""
@@ -272,25 +272,25 @@ jobs:
run: | run: |
git config --global user.name 'github-actions' git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com' git config --global user.email 'github-actions@github.com'
if git diff --quiet browser_tests/; then if git diff --quiet browser_tests/; then
echo "No changes to commit" echo "No changes to commit"
echo "has-changes=false" >> $GITHUB_OUTPUT echo "has-changes=false" >> $GITHUB_OUTPUT
exit 0 exit 0
fi fi
echo "==========================================" echo "=========================================="
echo "COMMITTING CHANGES" echo "COMMITTING CHANGES"
echo "==========================================" echo "=========================================="
echo "has-changes=true" >> $GITHUB_OUTPUT echo "has-changes=true" >> $GITHUB_OUTPUT
git add browser_tests/ git add browser_tests/
git commit -m "[automated] Update test expectations" git commit -m "[automated] Update test expectations"
echo "Pushing to ${{ needs.setup.outputs.branch }}..." echo "Pushing to ${{ needs.setup.outputs.branch }}..."
git push origin ${{ needs.setup.outputs.branch }} git push origin ${{ needs.setup.outputs.branch }}
echo "✓ Commit and push successful" echo "✓ Commit and push successful"
- name: Add Done Reaction - name: Add Done Reaction
@@ -306,4 +306,4 @@ jobs:
if: always() && github.event_name == 'pull_request' if: always() && github.event_name == 'pull_request'
run: gh pr edit ${{ needs.setup.outputs.pr-number }} --remove-label "New Browser Test Expectations" run: gh pr edit ${{ needs.setup.outputs.pr-number }} --remove-label "New Browser Test Expectations"
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -92,4 +92,3 @@ jobs:
base: ${{ github.event.inputs.branch }} base: ${{ github.event.inputs.branch }}
labels: | labels: |
Release Release

10
.yamllint Normal file
View File

@@ -0,0 +1,10 @@
extends: default
ignore: |
node_modules/
dist/
rules:
line-length: disable
document-start: disable
truthy: disable

14
scripts/cicd/check-yaml.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(git rev-parse --show-toplevel)"
cd "$ROOT_DIR"
mapfile -t yaml_files < <(git ls-files '*.yml' '*.yaml')
if [[ ${#yaml_files[@]} -eq 0 ]]; then
echo "No YAML files found to lint"
exit 0
fi
yamllint --config-file .yamllint "${yaml_files[@]}"