Skip to content

ci: separates the upload of content to Crowdin from the download of content #1864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Crowdin Action
name: Crowdin Upload

on:
push:
branches: [ gh-pages ]
workflow_dispatch:

permissions: write-all
# Cancel in progress workflows
# in the scenario where we already had a run going for that branch/tag but then triggered a new run
concurrency:
group: "${{ github.workflow }} ✨ ${{ github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
synchronize-with-crowdin:
Expand All @@ -20,13 +23,7 @@ jobs:
with:
upload_sources: true
upload_translations: false
download_translations: true
localization_branch_name: l10n
create_pull_request: true
pull_request_title: 'New Crowdin Translations'
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
pull_request_base_branch_name: 'gh-pages'
base_url: 'https://express.api.crowdin.com'
download_translations: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/update-external-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,29 @@ jobs:
labels: doc
team_reviewers: expressjs/docs-captains
branch: external-docs-${{ github.sha }}

synchronize-with-crowdin:
runs-on: ubuntu-latest
if: github.repository_owner == 'expressjs'
steps:
- name: Checkout
uses: actions/checkout@v4
# see all the options at https://github.com/crowdin/github-action
- name: Crowdin PR
uses: crowdin/github-action@v2
with:
# do not upload anything - this is a one-way operation download
upload_sources: false
upload_translations: false
# the rest of this controls how the PR comes in with new translations
download_translations: true
localization_branch_name: crowdin/translations
create_pull_request: true
pull_request_title: 'New Crowdin Translations'
pull_request_body: >
New Crowdin translations from the [express.js crowdin project](https://express.crowdin.com/u/projects/1). cc: @expressjs/docs-wg
pull_request_base_branch_name: 'gh-pages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
1 change: 1 addition & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ files:
preserve_hierarchy: true
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN
base_url: "https://express.api.crowdin.com"