-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (42 loc) · 1.78 KB
/
localazy-download.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 }}