Skip to content

Commit 2f8ea0a

Browse files
authored
Adjust #598 to only create a PR rather than pushing changes to main branch (#1162)
This pull request resolves the execution error of #598 CI job. The job pushes the changes directly to the main branch. However, our branch policies do not allow bypassing required checks, so it always fails. This pull request changes its behavior just to create a pull request and then ask humans to review (actually you don't need to check translation results though) and merge it.
1 parent ae4ba3c commit 2f8ea0a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/update-docs.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515

1616
jobs:
1717
update-docs:
18+
if: "!contains(github.event.head_commit.message, 'Update all translated document pages')"
1819
name: Build and Push Translated Docs
1920
runs-on: ubuntu-latest
2021
timeout-minutes: 20
@@ -34,14 +35,26 @@ jobs:
3435
- name: Build full docs
3536
run: make build-full-docs
3637

37-
- name: Commit and push changes
38+
- name: Commit changes
39+
id: commit
3840
run: |
3941
git config user.name "github-actions[bot]"
4042
git config user.email "github-actions[bot]@users.noreply.github.com"
4143
git add docs/
4244
if [ -n "$(git status --porcelain)" ]; then
4345
git commit -m "Update all translated document pages"
44-
git push
46+
echo "committed=true" >> "$GITHUB_OUTPUT"
4547
else
4648
echo "No changes to commit"
49+
echo "committed=false" >> "$GITHUB_OUTPUT"
4750
fi
51+
52+
- name: Create Pull Request
53+
if: steps.commit.outputs.committed == 'true'
54+
uses: peter-evans/create-pull-request@v6
55+
with:
56+
commit-message: "Update all translated document pages"
57+
title: "Update all translated document pages"
58+
body: "Automated update of translated documentation"
59+
branch: update-translated-docs-${{ github.run_id }}
60+
delete-branch: true

0 commit comments

Comments
 (0)