Skip to content

Commit

Permalink
chore: upgrade pr-comment-ci (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 authored Aug 1, 2024
1 parent 7ef06d5 commit 9024e60
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/pr-comment-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
git push

0 comments on commit 9024e60

Please sign in to comment.