From 9024e60c19707dbe9af33fe212ae2fcea9733c86 Mon Sep 17 00:00:00 2001 From: liweijie0812 <674416404@qq.com> Date: Thu, 1 Aug 2024 18:41:33 +0800 Subject: [PATCH] chore: upgrade pr-comment-ci (#428) --- .github/workflows/pr-comment-ci.yml | 35 +++++++++++++++++++---------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr-comment-ci.yml b/.github/workflows/pr-comment-ci.yml index a489e620..45ed8951 100644 --- a/.github/workflows/pr-comment-ci.yml +++ b/.github/workflows/pr-comment-ci.yml @@ -11,12 +11,14 @@ jobs: next_action: ${{ steps.get-action.outputs.next_action }} if: ${{ github.event.issue.pull_request }} steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - uses: actions/github-script@v7 - id: get-action - with: + - uses: actions/checkout@v4 + with: + sparse-checkout: | + .github/CODEOWNERS + sparse-checkout-cone-mode: false + - uses: actions/github-script@v7 + id: get-action + with: script: | const user = context.payload.comment.user.login core.debug(`user: ${user}`) @@ -41,13 +43,21 @@ jobs: } if (body.startsWith('/update-snapshot')) { next_action='update-snapshot' - } + } + if(next_action){ + await github.rest.reactions.createForIssueComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: context.payload.comment.id, + content: 'rocket', + }) + } } else { core.warning('You are not collaborator'); } core.info(`next_action: ${next_action}`) core.setOutput('next_action', next_action) - + update-common: needs: check runs-on: ubuntu-latest @@ -60,15 +70,16 @@ jobs: env: GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }} run: gh pr checkout ${{ github.event.issue.number }} --recurse-submodules + - run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" - run: git submodule update --remote --merge - name: Commit Common run: | git add . - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" git commit -m "chore: update common" git push - + update-snapshot: needs: check runs-on: ubuntu-latest @@ -92,4 +103,4 @@ jobs: git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git commit -m "chore: update snapshot" - git push \ No newline at end of file + git push