Skip to content

Commit 2da701b

Browse files
authored
ci: separates the upload of content to Crowdin from the download of content (#1864)
1 parent a29e83d commit 2da701b

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

.github/workflows/crowdin.yml renamed to .github/workflows/crowdin-upload.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
name: Crowdin Action
1+
name: Crowdin Upload
22

33
on:
44
push:
55
branches: [ gh-pages ]
6-
workflow_dispatch:
76

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

1013
jobs:
1114
synchronize-with-crowdin:
@@ -20,13 +23,7 @@ jobs:
2023
with:
2124
upload_sources: true
2225
upload_translations: false
23-
download_translations: true
24-
localization_branch_name: l10n
25-
create_pull_request: true
26-
pull_request_title: 'New Crowdin Translations'
27-
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
28-
pull_request_base_branch_name: 'gh-pages'
29-
base_url: 'https://express.api.crowdin.com'
26+
download_translations: false
3027
env:
3128
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3229
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}

.github/workflows/update-external-docs.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,29 @@ jobs:
3636
labels: doc
3737
team_reviewers: expressjs/docs-captains
3838
branch: external-docs-${{ github.sha }}
39+
40+
synchronize-with-crowdin:
41+
runs-on: ubuntu-latest
42+
if: github.repository_owner == 'expressjs'
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v4
46+
# see all the options at https://github.com/crowdin/github-action
47+
- name: Crowdin PR
48+
uses: crowdin/github-action@v2
49+
with:
50+
# do not upload anything - this is a one-way operation download
51+
upload_sources: false
52+
upload_translations: false
53+
# the rest of this controls how the PR comes in with new translations
54+
download_translations: true
55+
localization_branch_name: crowdin/translations
56+
create_pull_request: true
57+
pull_request_title: 'New Crowdin Translations'
58+
pull_request_body: >
59+
New Crowdin translations from the [express.js crowdin project](https://express.crowdin.com/u/projects/1). cc: @expressjs/docs-wg
60+
pull_request_base_branch_name: 'gh-pages'
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
64+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

crowdin.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ files:
88
preserve_hierarchy: true
99
project_id_env: CROWDIN_PROJECT_ID
1010
api_token_env: CROWDIN_PERSONAL_TOKEN
11+
base_url: "https://express.api.crowdin.com"

0 commit comments

Comments
 (0)