Skip to content
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
23 changes: 23 additions & 0 deletions docs/EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [Custom `crowdin.yml` file location](#custom-crowdinyml-file-location)
- [Separate PRs for each target language](#separate-prs-for-each-target-language)
- [Checking out multiple branches in a single workflow](#checking-out-multiple-branches-in-a-single-workflow)
- [Repositories with Git LFS](#repositories-with-git-lfs)
- [Outputs](#outputs)
- [`pull_request_url`, `pull_request_number`](#pull_request_url-pull_request_number)
- [Triggers](#triggers)
Expand Down Expand Up @@ -457,6 +458,28 @@ jobs:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
```

### Repositories with Git LFS

If your source or translation files are tracked with [Git LFS](https://git-lfs.com/), enable LFS in the checkout step. The action then stores the downloaded translations as LFS objects and uploads them before pushing the localization branch:

```yml
steps:
- uses: actions/checkout@v7
with:
lfs: true

- name: Synchronize with Crowdin
uses: crowdin/github-action@v3
with:
download_translations: true
localization_branch_name: l10n_crowdin_translations
create_pull_request: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
```

## Triggers

### Cron schedule
Expand Down
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ push_to_branch() {
set +e
git commit --no-verify -m "${INPUT_COMMIT_MESSAGE}"
RESULT=$?
# --no-verify skips the Git LFS pre-push hook, so upload LFS objects explicitly
if [ "${RESULT}" -eq 0 ] && [ -n "$(git lfs ls-files 2>/dev/null)" ]; then
echo "PUSH GIT LFS OBJECTS"
git lfs push "${REPO_URL}" "${BRANCH}"
RESULT=$?
fi
if [ "${RESULT}" -eq 0 ]; then
git push --no-verify --force "${REPO_URL}"
RESULT=$?
Expand Down
Loading