chore(deps): update sanity dependencies to ^4.14.1 (#1380) #463
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: AI translate | |
| 'on': | |
| workflow_dispatch: | |
| inputs: | |
| locale: | |
| type: choice | |
| description: Locale to auto translate | |
| options: | |
| - ALL | |
| - be-BY | |
| - ca-ES | |
| - cs-CZ | |
| - da-DK | |
| - de-DE | |
| - es-ES | |
| - fi-FI | |
| - fr-FR | |
| - hr-HR | |
| - hu-HU | |
| - is-IS | |
| - it-IT | |
| - ja-JP | |
| - ka-GE | |
| - kn-IN | |
| - ko-KR | |
| - nb-NO | |
| - nl-NL | |
| - nn-NO | |
| - pl-PL | |
| - pt-BR | |
| - pt-PT | |
| - ro-RO | |
| - ru-KZ | |
| - sv-SE | |
| - th-TH | |
| - tr-TR | |
| - uk-UA | |
| - vi-VN | |
| - zh-Hans | |
| - zh-Hant | |
| default: ALL | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - package.json | |
| jobs: | |
| translate-and-pr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App token | |
| uses: actions/create-github-app-token@v2 | |
| id: generate-token | |
| with: | |
| app-id: ${{ secrets.ECOSPARK_APP_ID }} | |
| private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }} | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| cache: pnpm | |
| node-version: lts/* | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run reconcile | |
| run: pnpm run reconcile | |
| - name: Configure git | |
| run: | | |
| git config --global user.name 'AutoTranslator' | |
| git config --global user.email '[email protected]' | |
| git remote set-url origin "https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com/sanity-io/locales.git" | |
| - name: Run autotranslate for all locales | |
| if: >- | |
| ${{ github.event.inputs.locale == '' || github.event.inputs.locale == | |
| 'ALL' }} | |
| run: pnpm run autotranslate --git | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| - name: Run autotranslate for specific locale | |
| if: >- | |
| ${{ github.event.inputs.locale != '' && github.event.inputs.locale != | |
| 'ALL' }} | |
| run: >- | |
| pnpm run autotranslate --git --locale ${{ github.event.inputs.locale | |
| }} | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |