name: Updates translation progress

on:
  push:
    branches:
      - main

jobs:
  update-translation-progress-issue:
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - uses: actions/checkout@v4

      - uses: pnpm/action-setup@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version-file: ".nvmrc"
          cache: "pnpm"

      - name: Install dependencies
        run: pnpm install --frozen-lockfile --ignore-scripts

      - name: Update translation progress issue
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          pnpm run check-translation-jsons
          gh issue edit 1104 --body-file ./translation-progress.md
