π Download Localazy translations #23
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: π Download Localazy translations | |
on: | |
workflow_dispatch: # This allows the workflow to be triggered manually | |
jobs: | |
localazy-download-test: | |
name: Download translations and create PR | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download translations from Localazy | |
uses: localazy/download@v1 | |
with: | |
read_key: ${{ secrets.LOCALAZY_READ_KEY }} | |
write_key: ${{ secrets.LOCALAZY_WRITE_KEY }} | |
- name: Check for updated translations | |
id: check-changes | |
run: | | |
git diff --exit-code || echo "changes_detected=true" >> $GITHUB_OUTPUT | |
- name: Exit if no updated translations | |
if: steps.check-changes.outputs.changes_detected != 'true' | |
run: | | |
echo "No changes to commit. Exiting workflow." | |
exit 0 | |
- name: Generate branch name | |
if: steps.check-changes.outputs.changes_detected == 'true' | |
run: echo "BRANCH_NAME=translation-update-$(date --utc +%Y-%m-%dT%H-%M-%S)" >> $GITHUB_ENV | |
- name: Create a pull request | |
if: steps.check-changes.outputs.changes_detected == 'true' | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
branch: ${{ env.BRANCH_NAME }} | |
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github> | |
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
commit-message: Update translation files | |
title: '[AUTO] Update translation files' | |
body: 'Automated pull request to update translation files by pulling them from Localazy.' | |
base: main | |
labels: | | |
localazy | |
automated pr | |
assignees: ${{ github.actor }} |