Some checks failed
App Prod-Parity E2E Dispatch / dispatch (push) Failing after 10s
CD Storybook UI / build (push) Failing after 3m25s
CD Storybook UI / dispatch (push) Has been skipped
CD deploy main / website-changed-files (push) Successful in 18m8s
CI Agent Skills / changed-files-check (push) Successful in 18m9s
CI Create App E2E minimal / changed-files-check (push) Successful in 24s
CI Create App / changed-files-check (push) Successful in 26s
CI Docs / changed-files-check (push) Successful in 26s
CI Emails / changed-files-check (push) Successful in 28s
CI Example App Hello World / changed-files-check (push) Successful in 23s
CI Front / changed-files-check (push) Has been skipped
CI Example App Postcard / changed-files-check (push) Successful in 27s
CI UI / changed-files-check (push) Has been skipped
CI Utils Test / changed-files-check (push) Successful in 45s
CI Twenty Apps / discover (push) Successful in 1m3s
CD deploy main / deploy-main (push) Failing after 3s
CI Agent Skills / agent-skills-validate (push) Has been skipped
CI Create App / create-app-test (lint) (push) Has been skipped
CI Emails / emails-test (push) Has been skipped
CI Front / front-task (lingui:compile) (push) Has been skipped
CI Front / front-task (lint) (push) Has been skipped
CI Example App Postcard / example-app-postcard (push) Has been skipped
CI UI / ui-task (lint) (push) Has been skipped
CI UI / ui-task (pack-size) (push) Has been skipped
CI UI / ui-task (size) (push) Has been skipped
CI UI / ui-task (test) (push) Has been skipped
CI UI / ui-task (typecheck) (push) Has been skipped
CI Utils Test / utils-test (push) Has been skipped
CI Twenty Apps / ${{ matrix.app.name }} (push) Has been skipped
CI Emails / ci-emails-status-check (push) Successful in 2s
CI Example App Hello World / ci-example-app-hello-world-status-check (push) Successful in 2s
CI Example App Postcard / ci-example-app-postcard-status-check (push) Successful in 3s
CI UI / ui-sb-test (push) Has been skipped
CI Utils Test / ci-utils-test-status-check (push) Successful in 2s
CI Twenty Apps / ci-twenty-apps-status-check (push) Successful in 2s
CI UI / ci-ui-status-check (push) Successful in 2s
CI Desktop / desktop (push) Failing after 1m8s
Push docs to Crowdin / Push documentation to Crowdin (push) Failing after 55s
Push translations to Crowdin / Extract and upload translations (push) Failing after 5s
Push website translations to Crowdin / Extract and upload website translations (push) Failing after 5s
CI Create App / create-app-test (test) (push) Has been skipped
CI Create App / create-app-test (typecheck) (push) Has been skipped
CI Docs / docs-lint (push) Has been skipped
CI Example App Hello World / example-app-hello-world (push) Has been skipped
CI Front / front-task (lingui:extract) (push) Has been skipped
CI Front / front-task (test) (push) Has been skipped
CI Front / front-task (typecheck) (push) Has been skipped
CI UI / ui-sb-build (push) Failing after 1m32s
CI Twenty Apps / ${{ matrix.app.name }} (${{ matrix.server-source }}) (push) Has been skipped
CI Agent Skills / agent-skills-publish (push) Has been skipped
CI Create App / ci-create-app-status-check (push) Successful in 2s
CI Agent Skills / agent-skills-remote-source (push) Has been skipped
CI Create App E2E minimal / create-app-e2e-minimal (push) Has been cancelled
CI E2E Main / e2e-test (push) Has been cancelled
CI Front / front-sb-build (push) Has been cancelled
CI Front / front-build (push) Has been cancelled
CI Create App E2E minimal / ci-create-app-e2e-minimal-status-check (push) Has been cancelled
CI E2E Main / ci-e2e-main-status-check (push) Has been cancelled
CI E2E Main / notify-main-ci-failure (push) Has been cancelled
CI E2E Main / qa-scout-comment (push) Has been cancelled
CI Front / front-sb-test (push) Has been cancelled
CI Front / front-sb-screenshots (push) Has been cancelled
CI Front / ci-front-status-check (push) Has been cancelled
DPA Sub-Processor Sync / sync-subprocessors (push) Failing after 3s
AI Catalog Sync / sync-catalog (push) Failing after 2s
146 lines
5.7 KiB
YAML
146 lines
5.7 KiB
YAML
# Pull down website translations from Crowdin every two hours or when triggered manually.
|
|
# Schedule and workflow_dispatch always download. workflow_call downloads when
|
|
# force_pull is true. We cannot gate on `lingui compile --strict`: English is the
|
|
# fallback locale, so empty msgstr values compile successfully.
|
|
|
|
name: 'Pull website translations from Crowdin'
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 */2 * * *' # Every two hours.
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
inputs:
|
|
force_pull:
|
|
description: 'Download translations even though the caller was not triggered by a schedule'
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
pull_website_translations:
|
|
name: Pull website translations
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
with:
|
|
token: ${{ github.token }}
|
|
ref: ${{ github.head_ref || github.ref_name }}
|
|
|
|
- name: Setup website i18n branch
|
|
run: |
|
|
git fetch origin i18n-website || true
|
|
git checkout -B i18n-website origin/i18n-website || git checkout -b i18n-website
|
|
|
|
- name: Install dependencies
|
|
uses: ./.github/actions/yarn-install
|
|
|
|
- name: Build twenty-shared
|
|
run: npx nx build twenty-shared
|
|
|
|
- name: Stash any changes before pulling translations
|
|
run: |
|
|
git config --global user.name 'github-actions'
|
|
git config --global user.email 'github-actions@twenty.com'
|
|
git add .
|
|
git stash
|
|
|
|
# Repair machine-translation damage in Crowdin before downloading, so the
|
|
# catalogs that reach the repo are already correct rather than a cycle behind.
|
|
- name: Normalize translations in Crowdin
|
|
if: inputs.force_pull == true || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
|
run: npx tsx packages/twenty-utils/crowdin-normalizer/normalize-crowdin-translations.ts --project=4 --format=po --apply || echo "::warning::translation normalization failed (non-blocking)"
|
|
env:
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
|
|
- name: Pull website translations from Crowdin
|
|
if: inputs.force_pull == true || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
|
uses: crowdin/github-action@8868a33591d21088edfc398968173a3b98d51706 # v2
|
|
with:
|
|
upload_sources: false
|
|
upload_translations: false
|
|
download_translations: true
|
|
export_only_approved: false
|
|
localization_branch_name: i18n-website
|
|
base_url: 'https://twenty.api.crowdin.com'
|
|
auto_approve_imported: false
|
|
import_eq_suggestions: false
|
|
download_sources: false
|
|
push_sources: false
|
|
skip_untranslated_strings: false
|
|
skip_untranslated_files: false
|
|
push_translations: false
|
|
create_pull_request: false
|
|
skip_ref_checkout: true
|
|
dryrun_action: false
|
|
config: '.github/crowdin-website.yml'
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
# Website translations project
|
|
CROWDIN_PROJECT_ID: '4'
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
|
|
# As the files are extracted from a Docker container, they belong to root:root.
|
|
# We need to fix this before the next steps.
|
|
- name: Fix file permissions
|
|
run: sudo chown -R runner:docker .
|
|
|
|
- name: Normalize downloaded catalogs to lingui format
|
|
run: npx nx run twenty-website:lingui:extract
|
|
|
|
- name: Compile website translations
|
|
id: compile_translations
|
|
run: |
|
|
npx nx run twenty-website:lingui:compile
|
|
git status
|
|
git add packages/twenty-website/src/locales
|
|
if ! git diff --staged --quiet --exit-code; then
|
|
git commit -m "chore: compile website translations"
|
|
echo "changes_detected=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "changes_detected=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Push changes
|
|
if: steps.compile_translations.outputs.changes_detected == 'true'
|
|
run: git push origin HEAD:i18n-website
|
|
|
|
- name: Create pull request
|
|
if: steps.compile_translations.outputs.changes_detected == 'true'
|
|
run: |
|
|
if git diff --name-only origin/main..HEAD | grep -q .; then
|
|
gh pr create -B main -H i18n-website --title 'i18n - website translations' --body 'Created by Github action' || true
|
|
else
|
|
echo "No file differences between branches, skipping PR creation"
|
|
fi
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Mint twenty-infra dispatch token
|
|
id: app-token
|
|
if: steps.compile_translations.outputs.changes_detected == 'true'
|
|
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
|
with:
|
|
client-id: ${{ vars.TWENTY_WORKFLOW_DISPATCHER_CLIENT_ID }}
|
|
private-key: ${{ secrets.TWENTY_WORKFLOW_DISPATCHER_PRIVATE_KEY }}
|
|
owner: twentyhq
|
|
repositories: twenty-infra
|
|
permission-actions: write
|
|
|
|
- name: Trigger i18n automerge
|
|
if: steps.compile_translations.outputs.changes_detected == 'true'
|
|
env:
|
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
run: |
|
|
gh workflow run automerge-i18n.yaml --repo twentyhq/twenty-infra --ref main
|