You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add 'command' and 'command_args' options (#176)
- deprecate the _branch options_ in favor of the new _command options_
- add the `test-action.yml` GitHub workflow to test the Action
- refine Readme
- improve Examples
- enforce conventional commits specification
Note that the value of the `crowdin_branch_name` is `env.BRANCH_NAME` - this is the name of the current branch on which the action is running.
179
+
176
180
### Download only translations without pushing to a branch
177
181
178
-
It's possible only to download the translations without immediate PR creation.
179
-
It allows you to post-process the downloaded translations and create a PR later.
182
+
It's possible to just download the translations without creating a PR immediately. It allows you to post-process the downloaded translations and create a PR later.
You can use the [Create Pull Request](https://github.com/marketplace/actions/create-pull-request) GitHub Action to create a PR with the downloaded translations.
212
+
208
213
### Advanced Pull Request configuration
209
214
210
215
There is a possibility to specify labels, assignees, reviewers for PR created by the Action.
@@ -247,19 +252,22 @@ jobs:
247
252
248
253
### Custom `crowdin.yml` file location
249
254
255
+
By default, the Action looks for the `crowdin.yml` file in the repository root. You can specify a custom location of the configuration file:
256
+
250
257
```yaml
251
-
...
258
+
# ...
252
259
253
260
- name: Crowdin
254
261
uses: crowdin/github-action@v1
255
262
with:
256
263
config: '.github/crowdin.yml'
257
-
258
-
...
264
+
#...
259
265
```
260
266
261
267
### Separate PRs for each target language
262
268
269
+
You can use the [`matrix`](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs) feature of GitHub Actions to create separate PRs for each target language:
In the example above, the workflow will fail if the translation progress is less than 100%.
393
+
394
+
Visit the [official documentation](https://crowdin.github.io/crowdin-cli/commands/crowdin-status) to learn more about the available translation status options.
Visit the [official documentation](https://crowdin.github.io/crowdin-cli/commands/crowdin-pre-translate) to learn more about the available pre-translation options.
[](https://github.com/crowdin/github-action/network/dependents?package_id=UGFja2FnZS0yOTQyNTU3MzA0)
15
16
[](https://github.com/crowdin/github-action/releases/latest)
This action allows you to easily integrate and automate the localization of your Crowdin project into the GitHub Actions workflow.
25
+
26
+
- Upload sources to Crowdin.
27
+
- Upload translations to Crowdin.
25
28
- Downloads translations from Crowdin.
29
+
- Download sources from Crowdin.
26
30
- Creates a PR with the translations.
31
+
- Run any Crowdin CLI command.
27
32
28
33
## Usage
34
+
29
35
Set up a workflow in *.github/workflows/crowdin.yml* (or add a job to your existing workflows).
30
36
31
-
Read the [Configuring a workflow](https://help.github.com/en/articles/configuring-a-workflow) article for more details on how to create and set up custom workflows.
37
+
Read the [Configuring a workflow](https://help.github.com/en/articles/configuring-a-workflow) article for more details on creating and setting up GitHub workflows.
32
38
33
39
```yaml
34
40
name: Crowdin Action
@@ -67,12 +73,9 @@ jobs:
67
73
> **Note**
68
74
> In case you want to use an [automatic GitHub authentication token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication), you need to assign the [`write` permission to your job](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) and [allow GH Actions to create Pull Requests](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests).
69
75
70
-
:file_folder: For more examples see the [EXAMPLES.md](/EXAMPLES.md)
71
-
72
-
:clipboard: To explore the common questions about Crowdin GitHub Action usage visit the [Wiki](https://github.com/crowdin/github-action/wiki).
73
-
74
76
## Supported options
75
-
The default action is to upload sources. Though, you can set different actions through the “with” options. If you don't want to upload your sources to Crowdin, just set the `upload_sources` option to false.
77
+
78
+
The default action is to upload sources. However, you can set different actions using the "with" options. If you don't want to upload your sources to Crowdin, just set the `upload_sources` option to false.
76
79
77
80
By default, sources and translations are being uploaded to the root of your Crowdin project. Still, if you use branches, you can set the preferred source branch.
78
81
@@ -82,6 +85,7 @@ In case you don’t want to download translations from Crowdin (`download_transl
82
85
83
86
```yaml
84
87
- name: crowdin action
88
+
uses: crowdin/github-action@v1
85
89
with:
86
90
# Upload sources option
87
91
upload_sources: true
@@ -126,18 +130,6 @@ In case you don’t want to download translations from Crowdin (`download_transl
126
130
# If not specified default repository branch will be used.
127
131
pull_request_base_branch_name: not_default_branch
128
132
129
-
# Branch options
130
-
131
-
add_crowdin_branch: branch_name
132
-
# Title as it appears to translators
133
-
new_branch_title: 'development / main'
134
-
# Defines branch name and path in resulting translations bundle
# This is the name of the top-level directory that Crowdin will use for files.
@@ -160,22 +152,33 @@ In case you don’t want to download translations from Crowdin (`download_transl
160
152
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
161
153
162
154
# Config options
163
-
164
-
# The numeric project ID. Visit the Tools > API section in your Crowdin project
165
-
project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
166
-
167
-
# A Personal Access Token (see https://crowdin.com/settings#api-key)
168
-
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
155
+
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} # A Personal Access Token (see https://crowdin.com/settings#api-key)
156
+
project_id: ${{ secrets.CROWDIN_PROJECT_ID }} # The numeric project ID. Visit the Tools > API section in your Crowdin project
169
157
source: 'path/to/your/file'
170
158
translation: 'file/export/pattern'
171
-
base_url: 'https://crowdin.com'
172
-
base_path: 'project-base-path'
159
+
base_url: 'https://api.crowdin.com'
160
+
base_path: 'project-base-path'# Default: '.'
173
161
```
174
162
175
-
**Note:** For Crowdin Enterprise `base_url` is required and should be passed in the following way: `base_url: 'https://{organization-name}.crowdin.com'`
176
-
177
163
For more detailed descriptions of these options, see [`action.yml`](https://github.com/crowdin/github-action/blob/master/action.yml).
178
164
165
+
> **Note**
166
+
> The `base_url` is required For Crowdin Enterprise and should be passed in the following way: `base_url: 'https://{organization-name}.api.crowdin.com'`
167
+
168
+
### Crowdin CLI command
169
+
170
+
You can also run any other Crowdin CLI command by specifying the `command` and `command_args` _(optional)_ options. For example:
171
+
172
+
```yaml
173
+
- name: crowdin action
174
+
uses: crowdin/github-action@v1
175
+
with:
176
+
command: 'pre-translate'
177
+
command_args: '-l uk --method tm --branch main'
178
+
```
179
+
180
+
To see the full list of available commands, visit the [official documentation](https://crowdin.github.io/crowdin-cli/).
181
+
179
182
### Crowdin configuration file
180
183
181
184
If your workflow file specifies the `config` property, you'll need to add the following to your [Crowdin configuration file](https://support.crowdin.com/configuration-file/) (e.g. `crowdin.yml`):
@@ -189,15 +192,14 @@ When the workflow runs, the real values of your token and project ID will be inj
189
192
190
193
## Contributing
191
194
192
-
If you want to contribute please read the [Contributing](/CONTRIBUTING.md) guidelines.
195
+
If you would like to contribute please read the [Contributing](/CONTRIBUTING.md) guidelines.
193
196
194
197
## Seeking Assistance
195
-
If you find any problems or would like to suggest a feature, please feel free to file an issue on GitHub at [Issues Page](https://github.com/crowdin/github-action/issues).
196
198
197
-
Need help working with Crowdin GitHub Action or have any questions?
If you find any problems or would like to suggest a feature, please feel free to file an issue on GitHub at [Issues Page](https://github.com/crowdin/github-action/issues).
199
200
200
201
## License
202
+
201
203
<pre>
202
204
The Crowdin GitHub Action is licensed under the MIT License.
203
205
See the LICENSE file distributed with this work for additional
0 commit comments