name: Validate translations

on:
  push:
    branches: [ master ]
  workflow_dispatch:

jobs:
  generate-translation-report:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v6
          
      - name: Run XAML validator
        uses: ThePBone/XamlTranslationValidator@v1.3
        with:
          source-xaml: 'GalaxyBudsClient/i18n/en.axaml'
          translation-xaml: 'GalaxyBudsClient/i18n/*.axaml'
          output-directory: 'meta/'
          output-name-summary: 'translations.md'
          custom-note: 'Translation instructions are available [in the wiki](https://github.com/ThePBone/GalaxyBudsClient/wiki/3.-How-to-help-with-translations).'
    
      - name: Publish changes
        uses: stefanzweifel/git-auto-commit-action@v7
        with:
          commit_message: Update translation statuses
          file_pattern: meta/*.md
