Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6b085ea
[feat] Add issues: write permission to lint-and-format workflow
snomiao Aug 12, 2025
73f71fc
kick-format
snomiao Aug 12, 2025
7ee33e2
kick-format-modify-main-ts
snomiao Aug 12, 2025
0f747f3
use auto-commit-action to handle pullrequest-ref name
snomiao Aug 13, 2025
ec2888a
[auto-fix] Apply ESLint and Prettier fixe
snomiao Aug 13, 2025
45b43aa
feat: Add issues write permission to workflows to avoid lint and i18n…
snomiao Aug 13, 2025
b4bf72b
Merge branch 'main' into sno-lint-issue-write
snomiao Aug 13, 2025
fe0054d
[feat] Add Linux core dump to .gitignore (#4960)
snomiao Aug 13, 2025
c5581c9
[feat] Add alternative package manager lockfiles to .gitignore (#4961)
snomiao Aug 13, 2025
3024dcc
Update side toolbar menu (#4946)
pythongosssss Aug 13, 2025
ccaeab1
Bundled subgraph fixes (#4964)
AustinMroz Aug 13, 2025
ad7d231
show group self color in minimap (#4954)
jtydhr88 Aug 13, 2025
cd970bd
fix: Add guards for _listenerController.abort() calls in SubgraphNode…
christian-byrne Aug 13, 2025
01a0ebc
[feat] Restore group node conversion menu with deprecated label (#4967)
christian-byrne Aug 13, 2025
e27b44b
fix pricing for KlingImage2VideoNode (#4957)
bigcat88 Aug 14, 2025
405b97c
[feat] Merge commit-back workflows into unified auto-fix-and-update w…
snomiao Aug 14, 2025
a7dd696
[feat] Add issues: write permission to lint-and-format workflow
snomiao Aug 12, 2025
943359e
kick-format
snomiao Aug 12, 2025
39686ef
kick-format-modify-main-ts
snomiao Aug 12, 2025
a88d46b
use auto-commit-action to handle pullrequest-ref name
snomiao Aug 13, 2025
8d48467
[auto-fix] Apply ESLint and Prettier fixe
snomiao Aug 13, 2025
1643baf
feat: Add issues write permission to workflows to avoid lint and i18n…
snomiao Aug 13, 2025
3021b60
[feat] Merge commit-back workflows into unified auto-fix-and-update w…
snomiao Aug 14, 2025
3a869d9
Merge branch 'sno-lint-issue-write--merge-with-locales-update' of git…
snomiao Aug 14, 2025
8afc0b9
kick-format
snomiao Aug 12, 2025
aab6c0c
kick-format-modify-main-ts
snomiao Aug 12, 2025
b61ecef
[auto-fix] Apply ESLint and Prettier fixe
snomiao Aug 13, 2025
9a38141
chore(auto-fix-and-update.yaml): update comments to clarify job purpo…
snomiao Aug 14, 2025
7f86f3f
e Merge branch 'sno-lint-issue-write--merge-with-locales-update' of g…
snomiao Aug 14, 2025
253853b
kick-format
snomiao Aug 14, 2025
1aa2a66
fix: Replace raw text with i18n translation key to test workflow
snomiao Aug 14, 2025
b87a251
fix: Replace manual workflow setup with Comfy-Org setup action for Pl…
snomiao Aug 14, 2025
2e6bf48
[feat] Add comprehensive caching to CI/CD workflows
snomiao Aug 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 206 additions & 0 deletions .github/workflows/auto-fix-and-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
name: Auto-fix and Update

on:
pull_request:
branches-ignore: [wip/*, draft/*, temp/*]

permissions:
contents: write
pull-requests: write
issues: write

jobs:
auto-fix-and-update:
# Only run on PRs from the same repository (not forks) to avoid permission issues, auto fix any lint and formats, update locales, and commit the changes back
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Setup ComfyUI Frontend and Backend
uses: Comfy-Org/[email protected]

# Step 1: Cache ESLint for better performance
- name: Cache ESLint
uses: actions/cache@v4
with:
path: ComfyUI_frontend/.eslintcache
key: ${{ runner.os }}-eslint-${{ hashFiles('ComfyUI_frontend/eslint.config.js', 'ComfyUI_frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-eslint-

# Step 2: Run lint and format fixes
- name: Run ESLint with auto-fix
run: npm run lint:fix
working-directory: ComfyUI_frontend

- name: Run Prettier with auto-format
run: npm run format
working-directory: ComfyUI_frontend

# Step 3: Update locales (only if there are relevant changes)
- name: Check if locale updates needed
id: check-locale-changes
run: |
# Check if there are changes to files that would affect locales
if git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -E '\.(vue|ts|tsx)$' | grep -v test | head -1; then
echo "locale_updates_needed=true" >> $GITHUB_OUTPUT
else
echo "locale_updates_needed=false" >> $GITHUB_OUTPUT
fi
working-directory: ComfyUI_frontend

- name: Install Playwright Browsers
if: steps.check-locale-changes.outputs.locale_updates_needed == 'true'
run: npx playwright install chromium --with-deps
working-directory: ComfyUI_frontend

- name: Start dev server
if: steps.check-locale-changes.outputs.locale_updates_needed == 'true'
run: npm run dev:electron &
working-directory: ComfyUI_frontend

- name: Update en.json
if: steps.check-locale-changes.outputs.locale_updates_needed == 'true'
run: npm run collect-i18n -- scripts/collect-i18n-general.ts
env:
PLAYWRIGHT_TEST_URL: http://localhost:5173
working-directory: ComfyUI_frontend

- name: Update translations
if: steps.check-locale-changes.outputs.locale_updates_needed == 'true'
run: npm run locale
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
working-directory: ComfyUI_frontend

# Step 4: Check for any changes from both lint-format and locale updates
- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
# Show what changed for debugging
echo "Changed files:"
git status --porcelain
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
working-directory: ComfyUI_frontend

# Step 5: Commit all changes in a single commit
- name: Commit auto-fixes and locale updates
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git fetch origin ${{ github.head_ref }}
# Stash any local changes before checkout
git stash -u
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
# Apply the stashed changes if any
git stash pop || true
git add .
git diff --staged --quiet || git commit -m "[auto-fix] Apply ESLint, Prettier fixes and update locales"
git push origin HEAD:${{ github.head_ref }}
working-directory: ComfyUI_frontend

# Step 6: Run final validation
- name: Final validation
run: |
npm run lint
npm run format:check
npm run knip
working-directory: ComfyUI_frontend

# Step 7: Comment on PR about what was fixed
- name: Comment on PR about auto-fixes
if: steps.verify-changed-files.outputs.changed == 'true'
uses: actions/github-script@v7
with:
script: |
let changes = [];
if ('${{ steps.check-locale-changes.outputs.locale_updates_needed }}' === 'true') {
changes.push('Locale updates');
}
// Always include lint/format as we ran them
changes.push('ESLint auto-fixes', 'Prettier formatting');

const changesText = changes.join('\n- ');

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## 🔧 Auto-fixes Applied

This PR has been automatically updated with the following changes:

- ${changesText}

**⚠️ Important**: Your local branch is now behind. Run \`git pull\` before making additional changes to avoid conflicts.`
});

# Separate job for fork PRs that can't auto-commit, we only check lint and formats, and do not commit back
fork-pr-check:
if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Cache ESLint
uses: actions/cache@v4
with:
path: .eslintcache
key: ${{ runner.os }}-eslint-fork-${{ hashFiles('eslint.config.js', 'package-lock.json') }}
restore-keys: |
${{ runner.os }}-eslint-fork-

- name: Check linting and formatting
id: check-lint-format
run: |
# Run checks and capture exit codes
npm run lint || echo "lint_failed=true" >> $GITHUB_OUTPUT
npm run format:check || echo "format_failed=true" >> $GITHUB_OUTPUT
npm run knip || echo "knip_failed=true" >> $GITHUB_OUTPUT

- name: Comment on fork PR about manual fixes needed
if: steps.check-lint-format.outputs.lint_failed == 'true' || steps.check-lint-format.outputs.format_failed == 'true' || steps.check-lint-format.outputs.knip_failed == 'true'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## ⚠️ Linting/Formatting Issues Found

This PR has linting or formatting issues that need to be fixed.

**Since this PR is from a fork, auto-fix cannot be applied automatically.**

### Option 1: Set up pre-commit hooks (recommended)
Run this once to automatically format code on every commit:
\`\`\`bash
npm run prepare
\`\`\`

### Option 2: Fix manually
Run these commands and push the changes:
\`\`\`bash
npm run lint:fix
npm run format
\`\`\`

See [CONTRIBUTING.md](https://github.com/Comfy-Org/ComfyUI_frontend/blob/main/CONTRIBUTING.md#git-pre-commit-hooks) for more details.`
});
51 changes: 0 additions & 51 deletions .github/workflows/i18n.yaml

This file was deleted.

83 changes: 0 additions & 83 deletions .github/workflows/lint-and-format.yaml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Get current version
id: current_version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
Expand All @@ -34,6 +35,13 @@ jobs:
else
echo "is_prerelease=false" >> $GITHUB_OUTPUT
fi
- name: Cache Vite build
uses: actions/cache@v4
with:
path: node_modules/.vite
key: ${{ runner.os }}-vite-release-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-vite-release-
- name: Build project
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
Expand Down Expand Up @@ -117,6 +125,7 @@ jobs:
with:
node-version: 'lts/*'
registry-url: https://registry.npmjs.org
cache: 'npm'
- run: npm ci
- run: npm run build:types
- name: Publish package
Expand Down
Loading