-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Automated, scheduled crowdin sync #7272
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
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
13b4f71
chore: add wip action
bmuenzenmeyer f3c0c44
feat: automated crowdin sync
bmuenzenmeyer 1f17c61
add dry run, workflow_dispatch
bmuenzenmeyer 5a18107
rename token
bmuenzenmeyer c09d91a
add mention of translation deployment
bmuenzenmeyer e35936a
Update .github/workflows/translations-sync.yml
bmuenzenmeyer 8f2c952
docs: clarified our translation flows
bmuenzenmeyer c61b594
separate translation source upload from download
bmuenzenmeyer 1dcdff3
Update TRANSLATION.md
bmuenzenmeyer 7d27852
Update .github/workflows/translations-sync.yml
bmuenzenmeyer 7a64c04
Update .github/workflows/translations-upload.yml
bmuenzenmeyer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
.github/workflows/translations-pr.yml → ...flows/translations-pr-lint-and-format.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # This action automates the synchronization of our crowdin translations, so that a human does not need to kick it off from the crowdin UI | ||
| # See translations-upload.yml for automation to upload our source content | ||
| # See translations-pr-lint-and-format.yml for quality control we conduct on ingress of new translations. | ||
| name: Crowdin Download | ||
|
|
||
| on: | ||
| workflow_dispatch: # Allow running when we want to, for events such as urgent translation mistakes or 100% completed languages | ||
| schedule: | ||
| - cron: '0 5 * * 5' # At 05:00 on Fridays. This guarantees that we have the 72 hour weekend time to review translations. | ||
|
|
||
| # Cancel any runs on the same branch | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| # These permissions required by `crowdin/github-action` | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| synchronize-with-crowdin: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| # see all the options at https://github.com/crowdin/github-action | ||
| - name: crowdin action | ||
| uses: crowdin/github-action@2d540f18b0a416b1fbf2ee5be35841bd380fc1da # v2.3.0 | ||
| 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: chore/crowdin | ||
| create_pull_request: true | ||
| pull_request_title: '[automated]: crowdin sync' | ||
| pull_request_body: 'New Crowdin translations from the [Node.js Crowdin project](https://crowdin.com/project/nodejs-web)' | ||
| pull_request_labels: github_actions:pull-request | ||
| commit_message: 'chore: synced translations from crowdin [skip ci]' | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # A numeric ID, found at https://crowdin.com/project/nodejs-web/tools/api | ||
| CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
| # Created from https://crowdin.com/settings#api-key logged in using nodejs-crowdin-bot | ||
| CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # This action automates the upload of our source content to crowdin. | ||
| # See translations-sync.yml for the automation to download new translations on a schedule | ||
| # See translations-pr-lint-and-format.yml for quality control we conduct on ingress of new translations. | ||
| name: Crowdin Upload | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| # Cancel any runs on the same branch | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| upload-to-crowdin: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| # see all the options at https://github.com/crowdin/github-action | ||
| - name: crowdin action | ||
| uses: crowdin/github-action@2d540f18b0a416b1fbf2ee5be35841bd380fc1da # v2.3.0 | ||
| with: | ||
| # only upload sources, ensuring this is a one-way operation | ||
| upload_sources: true | ||
| upload_translations: false | ||
| download_translations: false | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # A numeric ID, found at https://crowdin.com/project/nodejs-web/tools/api | ||
| CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
| # Created from https://crowdin.com/settings#api-key logged in using nodejs-crowdin-bot | ||
| CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.