mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-24 08:44:06 +00:00
## Problem The `update-locales` workflow was failing with the error: ``` Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/ComfyUI_frontend/ComfyUI_frontend/.github/actions/setup-frontend'. Did you forget to run actions/checkout before running your local action? ``` Ref: https://github.com/Comfy-Org/ComfyUI_frontend/actions/runs/18270266173/job/52011427608 ## Solution Added a checkout step using `actions/checkout@v5` before the "Setup Frontend" step. This ensures the repository code (including the local action definition) is available before GitHub Actions tries to use it. ## Changes - Added checkout step to `.github/workflows/update-locales.yaml` - Uses `actions/checkout@v5` to checkout the repository before referencing the local custom action This is a minimal fix that follows GitHub Actions best practices. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5938-fix-Add-checkout-step-before-using-local-action-in-update-locales-workflow-2846d73d365081cfb720ffaa528ce26e) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com>
63 lines
2.3 KiB
YAML
63 lines
2.3 KiB
YAML
name: Update Locales
|
|
|
|
on:
|
|
# Manual dispatch for urgent translation updates
|
|
workflow_dispatch:
|
|
# Only trigger on PRs to main/master - additional branch filtering in job condition
|
|
pull_request:
|
|
branches: [ main ]
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
update-locales:
|
|
# Branch detection: Only run for manual dispatch or version-bump-* branches from main repo
|
|
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
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup Frontend
|
|
uses: ./.github/actions/setup-frontend
|
|
|
|
- name: Cache tool outputs
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
ComfyUI_frontend/.cache
|
|
ComfyUI_frontend/.cache
|
|
key: i18n-tools-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
i18n-tools-cache-${{ runner.os }}-
|
|
- name: Setup Playwright
|
|
uses: ./.github/actions/setup-playwright
|
|
- name: Start 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.
|
|
run: pnpm dev:electron &
|
|
working-directory: ComfyUI_frontend
|
|
- name: Update en.json
|
|
run: pnpm collect-i18n
|
|
env:
|
|
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
|
working-directory: ComfyUI_frontend
|
|
- name: Update translations
|
|
run: pnpm locale
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
working-directory: ComfyUI_frontend
|
|
- name: Commit updated locales
|
|
run: |
|
|
git config --global user.name 'github-actions'
|
|
git config --global user.email 'github-actions@github.com'
|
|
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 src/locales/
|
|
git diff --staged --quiet || git commit -m "Update locales [skip ci]"
|
|
git push origin HEAD:${{ github.head_ref }}
|
|
working-directory: ComfyUI_frontend
|