Skip to content

Commit

Permalink
add push_translations option
Browse files Browse the repository at this point in the history
  • Loading branch information
VBeytok committed May 3, 2020
1 parent ef13ceb commit 20cebe1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@v2

- name: crowdin action
uses: crowdin/[email protected].3
uses: crowdin/[email protected].4
with:
upload_translations: true
download_translations: true
Expand Down Expand Up @@ -58,6 +58,7 @@ In case you don’t want to download translations from Crowdin (`download_transl
# download options
download_translations: true
language: 'uk'
push_translations: true
localization_branch_name: l10n_crowdin_action
create_pull_request: true
Expand Down
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,22 @@ inputs:
language:
description: 'Use this option to download translations for a single specified language'
required: false
push_translations:
description: 'Download translations with pushing to branch'
default: 'true'
required: false
localization_branch_name:
description: 'To download translations to the specified version branch'
default: 'l10n_crowdin_action'
required: false
create_pull_request:
description: 'To download translations to the specified version branch'
description: 'Create pull request after pushing to branch'
default: 'true'
required: false

# global options
crowdin_branch_name:
description: 'To upload or download files to the specified version branch'
description: 'Option to upload or download files to the specified version branch in your Crowdin project'
required: false
identity:
description: 'Option to specify a path to user-specific credentials'
Expand Down
8 changes: 5 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ push_to_branch() {

git checkout -b ${LOCALIZATION_BRANCH};

download_translations;

if [[ -n "$(git status -s)" ]]; then
echo "PUSH TO BRANCH ${LOCALIZATION_BRANCH}";

Expand Down Expand Up @@ -155,5 +153,9 @@ if [[ "$INPUT_DOWNLOAD_TRANSLATIONS" = true ]]; then
exit 1;
};

push_to_branch;
download_translations;

if [[ "$INPUT_PUSH_TRANSLATIONS" = true ]]; then
push_to_branch;
fi
fi

0 comments on commit 20cebe1

Please sign in to comment.