From cd47ac853857c7305a1bb52c1782fec87d956327 Mon Sep 17 00:00:00 2001 From: Spedon <70063177+Sped0n@users.noreply.github.com> Date: Fri, 10 Nov 2023 16:44:52 +0800 Subject: [PATCH] Update github action (#142) * blind commit * chore(build.yml): replace manual git commands with create-pull-request action to update bundled artifacts The manual git commands for configuring user email and name, checking for changes, adding changes, committing changes, and pushing changes have been replaced with the create-pull-request action from peter-evans. This action creates a pull request with the title "Update bundled artifacts" and the commit message "Update bundled artifacts" on a branch named "update-artifacts" based on the main branch. This action is triggered when the push event occurs or when a pull request is merged and there are changes in the filter outputs. The action uses a personal access token (PAT) stored in the secrets of the repository. --- .github/workflows/build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d2b977..f599e66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,10 @@ jobs: - name: Push artifacts if: ${{ (github.event_name == 'push' || github.event.pull_request.merged == true) && needs.filter.outputs.any_changed == 'true' }} - run: | - git config --global user.email "noreply@github.com" - git config --global user.name "CI" - git diff --quiet || (git add -A && git commit -m "build: update bundled artifacts [skip ci]" && git push) + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.PAT }} + title: Update bundled artifacts + commit-message: Update bundled artifacts + branch: update-artifacts + base: main