AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
fix(translations): translation updates no longer get stuck or lost when main changes during sync (#16796)
Bartosz Majewski3dbe47966bfb
diff --git a/.github/workflows/crowdin-pr-merger.yml b/.github/workflows/crowdin-pr-merger.ymlindex a5342975251..d4cd04b2ae9 100644--- a/.github/workflows/crowdin-pr-merger.yml+++ b/.github/workflows/crowdin-pr-merger.yml@@ -22,6 +22,7 @@ jobs:uses: actions/checkout@v5with:ref: ${{ github.event.pull_request.head.sha }}+ fetch-depth: 0- name: Cache dependenciesuses: actions/cache@v5@@ -63,7 +64,26 @@ jobs:echo "Resetting branch to match remote repository..."git reset --hard origin/${{ github.event.pull_request.head.ref }}git clean -fd-++ - name: Merge latest main+ run: |+ git config --local user.email "[email protected]"+ git config --local user.name "automated-commits-ap"+ if ! git merge --no-edit origin/main; then+ for FILE in $(git diff --name-only --diff-filter=U); do+ if ! git cat-file -e "origin/main:$FILE" 2>/dev/null; then+ git rm -q -- "$FILE"+ continue+ fi+ case "$FILE" in+ */locales/*/translation.json|*/i18n/*.json) git checkout --ours -- "$FILE" ;;+ *) git checkout --theirs -- "$FILE" ;;+ esac+ git add -- "$FILE"+ done+ git commit --no-edit+ fi+- name: Run Node.js scriptrun: |echo "Running Node.js script..."@@ -75,26 +95,19 @@ jobs:# Check if there are any changesif [[ -n "$(git status --porcelain)" ]]; thenecho "Changes detected, committing..."-- # Configure git- git config --local user.email "[email protected]"- git config --local user.name "automated-commits-ap"-+# Add all changesgit add .# Commit with a descriptive messagegit commit -m "chore: auto bump translated pieces"-- # Push changes back to the PR branch- git push origin HEAD:${{ github.event.pull_request.head.ref }}-- echo "Changes committed and pushed to PR branch"+echo "has_changes=true" >> $GITHUB_OUTPUTelseecho "No changes detected, skipping commit"echo "has_changes=false" >> $GITHUB_OUTPUTfi+ git push origin HEAD:${{ github.event.pull_request.head.ref }}env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}diff --git a/.github/workflows/generate-translations.yml b/.github/workflows/generate-translations.ymlindex e0c45802444..ea367268574 100644--- a/.github/workflows/generate-translations.yml+++ b/.github/workflows/generate-translations.yml@@ -76,7 +76,7 @@ jobs:notify-failure:# Only run when any of the shards failed; still evaluate even if they failedif: ${{ github.repository == 'activepieces/activepieces' && always() && contains(needs.*.result, 'failure') }}- needs: [shard-0, shard-1, shard-2, shard-3, shard-4, shard-5]+ needs: [shard-0, shard-1, shard-2, shard-3, shard-4, shard-5, finalize]runs-on: ubuntu-lateststeps:- name: Notify Discord on shard failurediff --git a/.github/workflows/reusable-finalize-translations-pr.yml b/.github/workflows/reusable-finalize-translations-pr.ymlindex 3a6fc016740..0dc09d2dade 100644--- a/.github/workflows/reusable-finalize-translations-pr.yml+++ b/.github/workflows/reusable-finalize-translations-pr.yml@@ -16,6 +16,7 @@ jobs:uses: actions/checkout@v5with:token: ${{ secrets.GITHUB_TOKEN }}+ fetch-depth: 0- name: Cache dependenciesuses: actions/cache@v5@@ -54,6 +55,27 @@ jobs:git checkout -b $BRANCH_NAME origin/mainfi+ - name: Merge latest main+ run: |+ git fetch origin main+ if ! git merge --no-edit origin/main; then+ CONFLICTS=$(git diff --name-only --diff-filter=U)+ for FILE in $CONFLICTS; do+ if git cat-file -e "origin/main:$FILE" 2>/dev/null; then+ git checkout --theirs -- "$FILE"+ git add -- "$FILE"+ else+ git rm -q -- "$FILE"+ fi+ done+ git commit --no-edit+ for FILE in $(echo "$CONFLICTS" | grep '/src/i18n/translation.json$'); do+ if [ -f "$FILE" ]; then+ npm run cli pieces generate-translation-file -- "$(basename "$(dirname "$(dirname "$(dirname "$FILE")")")")"+ fi+ done+ fi+- name: Generate translation files for UIrun: npm run i18n:extract@@ -64,10 +86,10 @@ jobs:if [ -n "$(git status --porcelain)" ]; thengit add -Agit commit -m "feat: update UI translations [skip-changelog]"- git push origin $BRANCH_NAMEelseecho "No changes for UI translations in react app"fi+ git push origin $BRANCH_NAME- name: Check branch ahead of mainid: ahead@@ -76,14 +98,18 @@ jobs:run: |git fetch origingit checkout $BRANCH_NAME- LEFT_RIGHT=$(git rev-list --left-right --count origin/main...HEAD)- AHEAD=$(echo $LEFT_RIGHT | awk '{print $2}')- if [ "$AHEAD" -gt 0 ]; then- echo "changes=true" >> $GITHUB_OUTPUT- else+ if git diff --quiet origin/main HEAD; thenecho "changes=false" >> $GITHUB_OUTPUT+ else+ echo "changes=true" >> $GITHUB_OUTPUTfi+ - name: Delete unchanged branch+ if: steps.ahead.outputs.changes == 'false'+ env:+ BRANCH_NAME: ${{ inputs.branch_name }}+ run: git push origin --delete $BRANCH_NAME+- name: Create Pull Requestif: steps.ahead.outputs.changes == 'true'uses: actions/github-script@v8