From b0aa2ffc425371e33b1ec460c1a873befabdfc86 Mon Sep 17 00:00:00 2001 From: Jobobby04 Date: Fri, 23 Aug 2024 16:39:17 -0400 Subject: [PATCH] Test to auto-add translations label --- .github/workflows/pr_label.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/pr_label.yml diff --git a/.github/workflows/pr_label.yml b/.github/workflows/pr_label.yml new file mode 100644 index 000000000000..c436ae549ccb --- /dev/null +++ b/.github/workflows/pr_label.yml @@ -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 + }); + }