Merge Crowdin translation to eXo Mobile Project #112
This file contains 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
name: Merge Crowdin translation to eXo Mobile Project | |
on: | |
schedule: | |
- cron: '0 20 * * 3' # Wed at 08 PM UTC | |
workflow_dispatch: | |
env: | |
CROWDIN_SYNC_BRANCH: 'integration/6.2.x' | |
BASE_BRANCH: 'acceptance' | |
jobs: | |
# Sync phase is mandatory before the Merge job | |
synchronize-with-crowdin: | |
uses: exoplatform/exo-android/.github/workflows/crowdin_sync.yml@acceptance | |
secrets: inherit | |
merge-crowdin-translation: | |
needs: synchronize-with-crowdin | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.BASE_BRANCH }} | |
token: ${{ secrets.ADMIN_TOKEN }} | |
fetch-depth: 0 | |
- name: Merge Crowdin Translation to the base branch | |
id: merge_changes | |
run: | | |
echo "changestobecommitted=false" >> $GITHUB_OUTPUT | |
git merge --squash origin/${CROWDIN_SYNC_BRANCH} || exit 0 | |
echo "changestobecommitted=true" >> $GITHUB_OUTPUT | |
- name: Import GPG key | |
if: steps.merge_changes.outputs.changestobecommitted == 'true' | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.SWF_GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.SWF_GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Commit changes | |
if: steps.merge_changes.outputs.changestobecommitted == 'true' | |
run: | | |
git -c user.name='eXo Software Factory' -c user.email='[email protected]' commit -m 'Merge Translations' | |
- name: Push changes to base branch | |
if: steps.merge_changes.outputs.changestobecommitted == 'true' | |
run: git push origin ${BASE_BRANCH}:${BASE_BRANCH} |