Skip to content

feat: [ANDROAPP-7154] add the Compose sync error log dialog #1074

feat: [ANDROAPP-7154] add the Compose sync error log dialog

feat: [ANDROAPP-7154] add the Compose sync error log dialog #1074

name: Fix KMP Translations
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
fix-kmp-translations:
if: startsWith(github.head_ref, 'develop-transifex-') || startsWith(github.head_ref, 'main-transifex-')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v7.0.1
with:
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Remove escaped question marks from KMP compose resources
run: |
for dir in \
"tracker/src/commonMain/composeResources" \
"aggregates/src/commonMain/composeResources" \
"commonskmm/src/commonMain/composeResources" \
"login/src/commonMain/composeResources" \
"sync/src/commonMain/composeResources"; do
if [ -d "$dir" ]; then
find "$dir" -name "*.xml" -exec sed -i 's/\\?/?/g' {} \;
fi
done
git add -A
- name: Check if meaningful changes remain vs base branch
id: check
run: |
if git diff --cached --quiet origin/${{ github.base_ref }}; then
echo "has_changes=false" >> "$GITHUB_OUTPUT"
else
echo "has_changes=true" >> "$GITHUB_OUTPUT"
fi
# Uses the GH API to create the signed commit — the repo ruleset requires verified signatures.
- name: Commit and push fix
if: steps.check.outputs.has_changes == 'true'
uses: flex-development/gh-commit@177be4b5bca1b102400ca7220932d9ff7980fddb
with:
message: 'fix(translations): remove KMP-incompatible escaped question marks'
ref: ${{ github.head_ref }}
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}
- name: Close PR — no meaningful changes remain
if: steps.check.outputs.has_changes == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.pull_request.number }} \
--body "Closing automatically: after removing Android-style escaped \`\?\` characters (incompatible with KMP Compose resources), no translation changes remain."
gh pr close ${{ github.event.pull_request.number }} --delete-branch