Crowdin Translation Progress #66
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: Crowdin Translation Progress | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' # daily at 06:00 UTC | |
| workflow_dispatch: | |
| jobs: | |
| update-progress: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: staging | |
| - name: Fetch Crowdin progress | |
| run: node scripts/fetch-crowdin-progress.js | |
| env: | |
| CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | |
| CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | |
| - name: Fetch Crowdin top contributors | |
| run: node scripts/fetch-crowdin-contributors.js | |
| env: | |
| CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | |
| CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | |
| - name: Create pull request | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add src/data/translation-progress.json src/data/top-translators.json | |
| git diff --cached --quiet && echo "No changes" && exit 0 | |
| git checkout -b chore/update-crowdin-data | |
| git commit -m "chore: update translation progress from Crowdin [skip ci]" | |
| git push -f origin chore/update-crowdin-data | |
| gh pr list --head chore/update-crowdin-data --state open | grep -q . || \ | |
| gh pr create --base staging \ | |
| --title "chore: update translation progress from Crowdin" \ | |
| --body "Automated daily update of translation progress and top contributors data from Crowdin." | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |