mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
parent
e1f5064c9d
commit
4dbcd2544c
38
.github/workflows/label_translation-pr.yml
vendored
Normal file
38
.github/workflows/label_translation-pr.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
name: Label translation PRs
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
label-translation:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Fetch PR diff
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
gh api \
|
||||||
|
repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} \
|
||||||
|
--header "Accept: application/vnd.github.v3.diff" > pr.diff
|
||||||
|
|
||||||
|
- name: Detect ai_playerbot_texts inserts
|
||||||
|
id: detect
|
||||||
|
run: |
|
||||||
|
if grep -E '^\+.*INSERT[[:space:]]+INTO[[:space:]]+`?ai_playerbot_texts`?' pr.diff; then
|
||||||
|
echo "has_translation=true" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "has_translation=false" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Add label
|
||||||
|
if: steps.detect.outputs.has_translation == 'true'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
gh pr edit ${{ github.event.pull_request.number }} \
|
||||||
|
--add-label "Added translation"
|
||||||
Loading…
x
Reference in New Issue
Block a user