fix: the conventions rule for the SDK also matched the design system #1058
Workflow file for this run
This file contains hidden or 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: 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 |