streetmix/streetmix

View on GitHub
.github/workflows/update-translations.yml

Summary

Maintainability
Test Coverage
name: Update translations

on:
  schedule:
    # Daily at a specific time (7:30 chosen arbitrarily)
    - cron: "30 7 * * *"
  workflow_dispatch:

jobs:
  translations:
    runs-on: ubuntu-latest
    env:
      TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }}
      HUSKY: "0"
      CYPRESS_INSTALL_BINARY: "0"
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    # Use the current LTS version of Node.js
    - name: Use Node.js 18
      uses: actions/setup-node@v4
      with:
        node-version: '20'
    # TODO: only install necessary dependencies
    - name: Install dependencies
      run: npm install
    - name: Download translations
      run: npm run translations:download
    - name: Create pull request
      uses: peter-evans/create-pull-request@v6
      with:
        commit-message: "chore(translations): automated update"
        branch: "create-pull-request/update-translations"
        delete-branch: true
        title: "Automated update of translations"
        body: |
          - Translations updates

          Auto-generated by [create-pull-request][1]

          [1]: https://github.com/peter-evans/create-pull-request
        reviewers: louh