From ebd79fbd64f622528c0e092f5bbb51efe9a67365 Mon Sep 17 00:00:00 2001 From: fish9167 <674821954@qq.com> Date: Thu, 13 May 2021 11:11:54 +0800 Subject: [PATCH] Change GitHub Action steps (#3524) Change GitHub Action steps (create-pull-request ) --- native/.github/workflows/clang-format.yml | 29 ++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/native/.github/workflows/clang-format.yml b/native/.github/workflows/clang-format.yml index 013285edb4..d54df9f268 100644 --- a/native/.github/workflows/clang-format.yml +++ b/native/.github/workflows/clang-format.yml @@ -1,4 +1,4 @@ -name: Apply Clang Format +name: Apply clang format #on: [push, pull_request] on: @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2 with: token: ${{ github.token }} - ref: ${{ github.head_ref }} + ref: ${{ github.head_sha }} - id: get_change_files uses: fish9167/file-changes-action@v1.2.3 @@ -22,7 +22,7 @@ jobs: output: ' ' fileOutput: ' ' - - name: get change files + - name: Echo change files run: | cat $HOME/files.txt mv $HOME/files.txt ${{github.workspace}}/files.txt @@ -33,12 +33,19 @@ jobs: extensions: 'c,h,hpp,cpp,cxx' style: file inplace: True - - - uses: fish9167/git-auto-commit-action@v4 - with: - commit_message: Apply clang-format - commit_user_name: cocos-robot - commit_user_email: cocos-robot@cocos.com - commit_author: cocos-robot - push_options: --force + - name: Create Pull Request + uses: fish9167/create-pull-request@v3 + with: + title: '[ci skip][AUTO]: Automated PR to fix formatting' + body: | + Automated PR to fix formatting + committer: cocos-robot + author: cocos-robot + commit-message: "[ci skip][AUTO]: Automated clang-format update: ${{ github.event.pull_request.head.sha }} (#${{ github.event.number }})" + token: ${{ secrets.PR_TOKEN }} + push-to-fork: cocos-robot/cocos2d-x-lite + branch: t/bot/fix-format + branch-suffix: short-commit-hash + delete-branch: true + milestone: 1