From e875923a60c5b5f74c156227067098f7f15e2f5e Mon Sep 17 00:00:00 2001 From: coreybutler <770982+coreybutler@users.noreply.github.com> Date: Sat, 24 Oct 2026 10:49:51 -0500 Subject: [PATCH] ci: auto-translate non-English issues, PRs, and discussions Append English with lizheming/github-translate-action. No checkout on pull_request_target. Skip github-actions[bot] to avoid edit loops. --- .github/workflows/translate.yml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/translate.yml diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml new file mode 100644 index 0000000..bad9a9e --- /dev/null +++ b/.github/workflows/translate.yml @@ -0,0 +1,38 @@ +name: Translate + +on: + issues: + types: [opened, edited] + issue_comment: + types: [created, edited] + discussion: + types: [created, edited] + discussion_comment: + types: [created, edited] + pull_request_target: + types: [opened, edited] + pull_request_review_comment: + types: [created, edited] + +permissions: + contents: none + issues: write + discussions: write + pull-requests: write + +concurrency: + group: translate-${{ github.repository }}-${{ github.event.issue.number || github.event.pull_request.number || github.event.discussion.number || github.run_id }} + cancel-in-progress: true + +jobs: + translate: + if: github.actor != 'github-actions[bot]' + runs-on: ubuntu-latest + steps: + # No checkout: pull_request_target must not run fork code. + - uses: lizheming/github-translate-action@b657888aa452b4b40f493836fa4477f6b66a23e5 # main 2026-09-06 (node24) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + IS_MODIFY_TITLE: true + APPEND_TRANSLATION: true