自動翻訳パイプライン #9
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: 自動翻訳パイプライン | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| commit_hash: | |
| description: 'Target upstream commit hash' | |
| required: true | |
| type: string | |
| dry_run: | |
| description: 'Dry run mode (skip actual translation/commit/PR)' | |
| required: false | |
| type: boolean | |
| default: false | |
| jobs: | |
| translation-pipeline: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| checks: write | |
| contents: write | |
| deployments: write | |
| issues: write | |
| packages: write | |
| pull-requests: write | |
| repository-projects: write | |
| security-events: write | |
| statuses: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Install Python dependencies | |
| run: | | |
| cd .github/auto-translation | |
| pip install -r requirements.txt | |
| - name: Install Node.js dependencies | |
| run: npm ci | |
| - name: Add upstream remote | |
| run: | | |
| git remote add upstream https://github.com/jhipster/jhipster.github.io.git || true | |
| git fetch upstream | |
| - name: Run translation pipeline | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BOT_GIT_USER: jhipster-jp-bot | |
| BOT_GIT_EMAIL: jhipster-jp-bot@users.noreply.github.com | |
| LANGUAGE_TOOL_ENABLED: true | |
| DRY_RUN: ${{ github.event.inputs.dry_run }} | |
| run: | | |
| python .github/auto-translation/scripts/run_translation_pipeline.py \ | |
| --hash "${{ github.event.inputs.commit_hash }}" \ | |
| ${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }} | |
| - name: Upload classification results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: translation-classification-${{ github.event.inputs.commit_hash }} | |
| path: .github/auto-translation/classification.json | |
| retention-days: 30 | |
| - name: Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: translation-logs-${{ github.event.inputs.commit_hash }} | |
| path: .github/auto-translation/**/*.log | |
| retention-days: 7 | |
| if-no-files-found: ignore |