mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 08:50:05 +01:00
CI/AI translate: only run on src/i18n
This commit is contained in:
parent
4695f85829
commit
5f0575737f
1 changed files with 15 additions and 13 deletions
28
.github/workflows/translation-ai-check.yml
vendored
28
.github/workflows/translation-ai-check.yml
vendored
|
|
@ -14,18 +14,10 @@ permissions:
|
||||||
issues: write
|
issues: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
review:
|
changes:
|
||||||
name: Review Translation
|
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' ) }}
|
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
|
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:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
@ -36,11 +28,21 @@ jobs:
|
||||||
filters: |
|
filters: |
|
||||||
i18n:
|
i18n:
|
||||||
- 'src/i18n/**'
|
- 'src/i18n/**'
|
||||||
|
review:
|
||||||
|
name: Review Translation
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.backend == 'true' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
- name: Stop if i18n not changed
|
env:
|
||||||
if: steps.changes.outputs.i18n != 'true'
|
OPENAI_MODEL: gpt-5-mini
|
||||||
run: echo "No i18n changes in this PR; skipping." && exit 0
|
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: Determine PR number
|
- name: Determine PR number
|
||||||
id: pr
|
id: pr
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue