@@ -2,11 +2,11 @@ name: "i18n: Update Core"
22description : " Generates and updates translations for core ComfyUI components using OpenAI"
33
44on :
5- # Manual dispatch for urgent translation updates
5+ # Manual dispatch for urgent translation updates
66 workflow_dispatch :
77 # Only trigger on PRs to main/master - additional branch filtering in job condition
88 pull_request :
9- branches : [ main ]
9+ branches : [main]
1010 types : [opened, synchronize, reopened]
1111
1212jobs :
@@ -15,45 +15,45 @@ jobs:
1515 if : github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))
1616 runs-on : ubuntu-latest
1717 steps :
18- - name : Checkout repository
19- uses : actions/checkout@v5
18+ - name : Checkout repository
19+ uses : actions/checkout@v5
2020
21- # Setup playwright environment
22- - name : Setup ComfyUI Frontend
23- uses : ./.github/actions/setup-frontend
24- with :
25- include_build_step : true
26- - name : Setup ComfyUI Server
27- uses : ./.github/actions/setup-comfyui-server
28- with :
29- launch_server : true
30- - name : Setup Playwright
31- uses : ./.github/actions/setup-playwright
21+ # Setup playwright environment
22+ - name : Setup ComfyUI Frontend
23+ uses : ./.github/actions/setup-frontend
24+ with :
25+ include_build_step : true
26+ - name : Setup ComfyUI Server
27+ uses : ./.github/actions/setup-comfyui-server
28+ with :
29+ launch_server : true
30+ - name : Setup Playwright
31+ uses : ./.github/actions/setup-playwright
3232
33- - name : Start dev server
34- # Run electron dev server as it is a superset of the web dev server
35- # We do want electron specific UIs to be translated.
36- run : pnpm dev:electron &
33+ - name : Start dev server
34+ # Run electron dev server as it is a superset of the web dev server
35+ # We do want electron specific UIs to be translated.
36+ run : pnpm dev:electron &
3737
38- # Update locales, collect new strings and update translations using OpenAI, then commit changes
39- - name : Update en.json
40- run : pnpm collect-i18n
41- env :
42- PLAYWRIGHT_TEST_URL : http://localhost:5173
43- - name : Update translations
44- run : pnpm locale
45- env :
46- OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
47- - name : Commit updated locales
48- run : |
49- git config --global user.name 'github-actions'
50- git config --global user.email 'github-actions@github.com'
51- git fetch origin ${{ github.head_ref }}
52- # Stash any local changes before checkout
53- git stash -u
54- git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
55- # Apply the stashed changes if any
56- git stash pop || true
57- git add src/locales/
58- git diff --staged --quiet || git commit -m "Update locales"
59- git push origin HEAD:${{ github.head_ref }}
38+ # Update locales, collect new strings and update translations using OpenAI, then commit changes
39+ - name : Update en.json
40+ run : pnpm collect-i18n
41+ env :
42+ PLAYWRIGHT_TEST_URL : http://localhost:5173
43+ - name : Update translations
44+ run : pnpm locale
45+ env :
46+ OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
47+ - name : Commit updated locales
48+ run : |
49+ git config --global user.name 'github-actions'
50+ git config --global user.email 'github-actions@github.com'
51+ git fetch origin ${{ github.head_ref }}
52+ # Stash any local changes before checkout
53+ git stash -u
54+ git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
55+ # Apply the stashed changes if any
56+ git stash pop || true
57+ git add src/locales/
58+ git diff --staged --quiet || git commit -m "Update locales"
59+ git push origin HEAD:${{ github.head_ref }}
0 commit comments