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.
This commit is contained in:
Spedon
2023-11-10 16:44:52 +08:00
committed by GitHub
parent 3c9f19a506
commit cd47ac8538

View File

@@ -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