Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

ci: fix translate, allow manual dispatch (#30505)

Stephen Zhou9aaa08e19f87
diff --git a/.github/workflows/translate-i18n-base-on-english.yml b/.github/workflows/translate-i18n-base-on-english.yml
index a51350f6308..16d36361fdb 100644
--- a/.github/workflows/translate-i18n-base-on-english.yml
+++ b/.github/workflows/translate-i18n-base-on-english.yml
@@ -5,6 +5,7 @@ on:
branches: [main]
paths:
- 'web/i18n/en-US/*.json'
+ workflow_dispatch:
permissions:
contents: write
@@ -18,7 +19,8 @@ jobs:
run:
working-directory: web
steps:
- - uses: actions/checkout@v6
+ # Keep use old checkout action version for https://github.com/peter-evans/create-pull-request/issues/4272
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
@@ -26,21 +28,28 @@ jobs:
- name: Check for file changes in i18n/en-US
id: check_files
run: |
- git fetch origin "${{ github.event.before }}" || true
- git fetch origin "${{ github.sha }}" || true
- changed_files=$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" -- 'i18n/en-US/*.json')
- echo "Changed files: $changed_files"
- if [ -n "$changed_files" ]; then
+ # Skip check for manual trigger, translate all files
+ if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "FILES_CHANGED=true" >> $GITHUB_ENV
- file_args=""
- for file in $changed_files; do
- filename=$(basename "$file" .json)
- file_args="$file_args --file $filename"
- done
- echo "FILE_ARGS=$file_args" >> $GITHUB_ENV
- echo "File arguments: $file_args"
+ echo "FILE_ARGS=" >> $GITHUB_ENV
+ echo "Manual trigger: translating all files"
else
- echo "FILES_CHANGED=false" >> $GITHUB_ENV
+ git fetch origin "${{ github.event.before }}" || true
+ git fetch origin "${{ github.sha }}" || true
+ changed_files=$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" -- 'i18n/en-US/*.json')
+ echo "Changed files: $changed_files"
+ if [ -n "$changed_files" ]; then
+ echo "FILES_CHANGED=true" >> $GITHUB_ENV
+ file_args=""
+ for file in $changed_files; do
+ filename=$(basename "$file" .json)
+ file_args="$file_args --file $filename"
+ done
+ echo "FILE_ARGS=$file_args" >> $GITHUB_ENV
+ echo "File arguments: $file_args"
+ else
+ echo "FILES_CHANGED=false" >> $GITHUB_ENV
+ fi
fi
- name: Install pnpm