Skip to content

Merge pull request #29 from weblate/weblate-scribe-scribe-i18n #15

Merge pull request #29 from weblate/weblate-scribe-scribe-i18n

Merge pull request #29 from weblate/weblate-scribe-scribe-i18n #15

name: xcstrings_conversion.yml
on:
push:
branches:
- main
jobs:
# Check to make sure the localization files have actually changed.
conditional_job_check_files:
runs-on: ubuntu-latest
outputs:
json_changed: ${{ steps.check_file_changed.outputs.json_changed }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- shell: pwsh
id: check_file_changed
run: |
$diff = git diff --name-only HEAD^ HEAD
$SourceDiff = $diff | Where-Object { $_ -match '^Scribe-i18n/' -and $_ -match '.json$' }
$HasDiff = $SourceDiff.Length -gt 0
Write-Host "json_changed=$HasDiff" >> "$GITHUB_OUTPUT"
# Run xcstrings conversion script if needed.
conditional_job:
runs-on: ubuntu-latest
needs:
- conditional_job_check_files
if: needs.conditional_job_check_files.outputs.json_changed == 'True'
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Execute script to convert JSON to xcstrings
run: |
python convert_to_xcstrings.py