From 8e7d5833649f5c795f1ac9f5975b057dbc1759eb Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Thu, 19 Dec 2024 02:53:29 +0100 Subject: [PATCH] Add translation workflows --- .github/workflows/translate-pr.yml | 35 +++++++++++++++++++++++++++ .github/workflows/update-template.yml | 29 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/translate-pr.yml create mode 100644 .github/workflows/update-template.yml diff --git a/.github/workflows/translate-pr.yml b/.github/workflows/translate-pr.yml new file mode 100644 index 0000000..3972fcd --- /dev/null +++ b/.github/workflows/translate-pr.yml @@ -0,0 +1,35 @@ +name: Create pull request from translation form + +on: + issues: + types: [labeled] + +env: + GITHUB_EVENT_ISSUE: ${{ github.event.issue.number }} + +jobs: + extract: + if: ${{ github.event.label.name == 'translation' }} + runs-on: ubuntu-latest + + steps: + - name: Clone project + uses: actions/checkout@v4 + + - name: Extract translations + uses: p3lim/lua-translations@master + with: + action: extract + id: extract + + - name: Create pull request + uses: peter-evans/create-pull-request@v7 + with: + title: Update ${{ steps.extract.outputs.lang }} translation + body: + commit-message: | + Update ${{ steps.extract.outputs.lang }} translation + + Fixes #${{ github.event.issue.number }} + branch: update-translation-${{ github.event.issue.number }} + delete-branch: true diff --git a/.github/workflows/update-template.yml b/.github/workflows/update-template.yml new file mode 100644 index 0000000..456b1c1 --- /dev/null +++ b/.github/workflows/update-template.yml @@ -0,0 +1,29 @@ +name: Update translation issue template + +on: + push: + branches: + - master + tags-ignore: + - '**' + +jobs: + template: + runs-on: ubuntu-latest + steps: + - name: Clone project + uses: actions/checkout@v4 + + - name: Update issue template + uses: p3lim/lua-translations@master + with: + action: template + + - name: Create pull request + uses: peter-evans/create-pull-request@v7 + with: + title: Update translation issue template + body: + commit-message: Update translation issue template + branch: translation-issue-template + delete-branch: true