From aeaa00c421554d1747b209dccf4665e3bb0894af Mon Sep 17 00:00:00 2001 From: Michael S <54802506+jroya1@users.noreply.github.com> Date: Tue, 12 Jul 2022 12:02:12 +0300 Subject: [PATCH] Create gh action for creating translation issues (#674) * Create gh action for creating translation issues * Add template body & label check to translation gh * Update .github/workflows/translation.yml Co-authored-by: Tim Condon <0xTim@users.noreply.github.com> --- .../workflows/translation-issue-template.md | 13 ++++++++++ .github/workflows/translation.yml | 26 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/translation-issue-template.md create mode 100644 .github/workflows/translation.yml diff --git a/.github/workflows/translation-issue-template.md b/.github/workflows/translation-issue-template.md new file mode 100644 index 00000000..f82c8686 --- /dev/null +++ b/.github/workflows/translation-issue-template.md @@ -0,0 +1,13 @@ +--- +title: Translation needed for {{'#'}}{{env.PR_NUMBER}} +--- + +The docs have been updated in PR {{'#'}}{{env.PR_NUMBER}}. The translations should be updated if required. + +Languages: +- [ ] English +- [ ] Chinese +- [ ] German +- [ ] Dutch + +Assigned to @vapor/translations - please submit a PR with the relevant updates and check the box once merged. Please ensure you tag your PR with the `translation-update` so it doesn't create a new issue! \ No newline at end of file diff --git a/.github/workflows/translation.yml b/.github/workflows/translation.yml new file mode 100644 index 00000000..64cb6e7e --- /dev/null +++ b/.github/workflows/translation.yml @@ -0,0 +1,26 @@ +name: Check PR and create issue for translation + +on: + push: + branches: + - main + +jobs: + create: + name: Create issue + runs-on: ubuntu-latest + steps: + - name: Find PR + uses: 8BitJonny/gh-get-current-pr@2.1.0 + id: find-pr + with: + state: all + - uses: actions/checkout@v2 + - name: Create issue + if: steps.find-pr.outputs.number && !contains(steps.find-pr.outputs.pr_labels, 'translation-update') && !contains(steps.find-pr.outputs.pr_labels, 'no-translation-needed') + uses: JasonEtco/create-an-issue@v2 + env: + PR_NUMBER: ${{ steps.find-pr.outputs.number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + filename: .github/workflows/translation-issue-template.md \ No newline at end of file