summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorMihai Fufezan <mihai@fufexan.net>2025-11-17 14:17:26 +0200
committerMihai Fufezan <mihai@fufexan.net>2025-11-17 14:46:21 +0200
commit5f0575737fbf45fc454cde2841c23691e1345413 (patch)
tree358ba553bc44e2629c8b6cc79ffd8c33c6f0c908 /.github
parent4695f85829b73610975d04e694d46c04481e1b79 (diff)
CI/AI translate: only run on src/i18n
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/translation-ai-check.yml28
1 files changed, 15 insertions, 13 deletions
diff --git a/.github/workflows/translation-ai-check.yml b/.github/workflows/translation-ai-check.yml
index 55543279..ba824371 100644
--- a/.github/workflows/translation-ai-check.yml
+++ b/.github/workflows/translation-ai-check.yml
@@ -14,18 +14,10 @@ permissions:
issues: write
jobs:
- review:
- name: Review Translation
+ changes:
+ name: Check i18n changes
if: ${{ github.event_name == 'pull_request_target' || (github.event_name == 'issue_comment' && github.event.action == 'created' && github.event.issue.pull_request != null && github.event.comment.user.login == 'vaxerski' && github.event.comment.body == 'ai, please recheck' ) }}
runs-on: ubuntu-latest
- env:
- OPENAI_MODEL: gpt-5-mini
- SYSTEM_PROMPT: |
- You are a programmer and a translator. Your job is to review the attached patch for adding translation to a piece of software and make sure the submitted translation is not malicious, and that it makes sense. If the translation is not malicious, and doesn't contain obvious grammatical mistakes, say "Translation check OK". Otherwise, say "Translation check not ok" and list bad entries.
- Examples of bad translations include obvious trolling (slurs, etc) or nonsense sentences. Meaningful improvements may be suggested, but if there are only minor improvements, just reply with "Translation check OK". Do not provide anything but the result and (if applicable) the bad entries or improvements.
-
- AI_PROMPT: Translation patch below.
-
steps:
- name: Checkout source code
uses: actions/checkout@v5
@@ -36,11 +28,21 @@ jobs:
filters: |
i18n:
- 'src/i18n/**'
+ review:
+ name: Review Translation
+ needs: changes
+ if: ${{ needs.changes.outputs.backend == 'true' }}
+ runs-on: ubuntu-latest
+
+ env:
+ OPENAI_MODEL: gpt-5-mini
+ SYSTEM_PROMPT: |
+ You are a programmer and a translator. Your job is to review the attached patch for adding translation to a piece of software and make sure the submitted translation is not malicious, and that it makes sense. If the translation is not malicious, and doesn't contain obvious grammatical mistakes, say "Translation check OK". Otherwise, say "Translation check not ok" and list bad entries.
+ Examples of bad translations include obvious trolling (slurs, etc) or nonsense sentences. Meaningful improvements may be suggested, but if there are only minor improvements, just reply with "Translation check OK". Do not provide anything but the result and (if applicable) the bad entries or improvements.
- - name: Stop if i18n not changed
- if: steps.changes.outputs.i18n != 'true'
- run: echo "No i18n changes in this PR; skipping." && exit 0
+ AI_PROMPT: Translation patch below.
+ steps:
- name: Determine PR number
id: pr
run: |