feat: add full-sync option for manual workflow trigger #11
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: Auto Translate | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'locales/en/**' | |
| workflow_dispatch: | |
| inputs: | |
| full-sync: | |
| description: 'Force full re-translation (ignore incremental)' | |
| required: false | |
| default: 'false' | |
| type: boolean | |
| jobs: | |
| translate: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 # Need previous commit for incremental translation | |
| - name: Translate all locale files | |
| uses: Shipi18n/shipi18n-github-action@v1 | |
| with: | |
| api-key: ${{ secrets.SHIPI18N_API_KEY }} | |
| source-dir: 'locales/en' | |
| target-languages: 'es,fr,de' | |
| output-dir: 'locales' | |
| create-pr: 'true' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| incremental: ${{ github.event.inputs.full-sync == 'true' && 'false' || 'true' }} |