From 846c64a4835b0952fe66dab2a3349ed06573eef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Thu, 5 Mar 2026 18:03:24 +0100 Subject: [PATCH] ci: simplify translate workflow by using gh instead of peter-evans/create-pull-request --- .github/workflows/translate.yaml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/translate.yaml b/.github/workflows/translate.yaml index 94f782673..c6d60be0a 100644 --- a/.github/workflows/translate.yaml +++ b/.github/workflows/translate.yaml @@ -20,7 +20,6 @@ jobs: uses: actions/checkout@v6 with: fetch-depth: 0 - persist-credentials: false - id: md_files run: | FILES=$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" -- 'docs/*.md') @@ -51,19 +50,19 @@ jobs: FIX_MARKDOWN: true - name: Create Pull Request if: steps.md_files.outputs.found == 'true' - uses: peter-evans/create-pull-request@v8 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - title: "docs: update translations" - commit-message: "docs: update translations" - committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> - author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> - branch: translations/${{ github.run_id }} - delete-branch: true - body: | - Translation updates for: ${{ steps.md_files.outputs.files }}. - labels: | - translations - bot - draft: false + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + BRANCH="translations/${{ github.run_id }}" + git checkout -b "$BRANCH" + git add docs/ + git diff --cached --quiet && exit 0 + git commit -m "docs: update translations" --author="${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>" + git push origin "$BRANCH" + gh pr create \ + --title "docs: update translations" \ + --body "Translation updates for: ${{ steps.md_files.outputs.files }}." \ + --label "translations" \ + --label "bot"