Skip to content

Commit 846c64a

Browse files
committed
ci: simplify translate workflow by using gh instead of peter-evans/create-pull-request
1 parent 6268015 commit 846c64a

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

.github/workflows/translate.yaml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
uses: actions/checkout@v6
2121
with:
2222
fetch-depth: 0
23-
persist-credentials: false
2423
- id: md_files
2524
run: |
2625
FILES=$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" -- 'docs/*.md')
@@ -51,19 +50,19 @@ jobs:
5150
FIX_MARKDOWN: true
5251
- name: Create Pull Request
5352
if: steps.md_files.outputs.found == 'true'
54-
uses: peter-evans/create-pull-request@v8
5553
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
with:
58-
title: "docs: update translations"
59-
commit-message: "docs: update translations"
60-
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
61-
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
62-
branch: translations/${{ github.run_id }}
63-
delete-branch: true
64-
body: |
65-
Translation updates for: ${{ steps.md_files.outputs.files }}.
66-
labels: |
67-
translations
68-
bot
69-
draft: false
54+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
run: |
56+
git config user.name "github-actions[bot]"
57+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
58+
BRANCH="translations/${{ github.run_id }}"
59+
git checkout -b "$BRANCH"
60+
git add docs/
61+
git diff --cached --quiet && exit 0
62+
git commit -m "docs: update translations" --author="${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>"
63+
git push origin "$BRANCH"
64+
gh pr create \
65+
--title "docs: update translations" \
66+
--body "Translation updates for: ${{ steps.md_files.outputs.files }}." \
67+
--label "translations" \
68+
--label "bot"

0 commit comments

Comments
 (0)