Merge pull request #24 from Jag-Marcel/new-strings #11
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: 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 |