name: Crowdin

on:
  workflow_dispatch:

jobs:
  update-pot:
    name: Update .pot file
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - name: Checkout code
        uses: actions/checkout@v5
        if: github.repository == 'hestiacp/hestiacp'
      - name: crowdin action
        uses: crowdin/github-action@v2
        if: github.repository == 'hestiacp/hestiacp'
        with:
          upload_sources: true
          upload_translations: false
          download_translations: false
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
          CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
