Test to auto-add translations label

(cherry picked from commit b0aa2ffc425371e33b1ec460c1a873befabdfc86)
This commit is contained in:
Jobobby04 2024-08-23 16:39:17 -04:00 committed by Cuong-Tran
parent 4068267cc2
commit f95d19782b
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2

26
.github/workflows/pr_label.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: Label PRs
on:
pull_request:
types: [opened]
jobs:
label_pr:
runs-on: ubuntu-latest
steps:
- name: Check PR and Add Label
uses: actions/github-script@v7
with:
script: |
const prAuthor = context.payload.pull_request.user.login;
if (prAuthor === 'weblate') {
const labels = ['Translations'];
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: labels
});
}