-
Notifications
You must be signed in to change notification settings - Fork 103
44 lines (41 loc) · 1.26 KB
/
review-trigger.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Review-Trigger
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- review_requested
- review_request_removed
- ready_for_review
pull_request_review:
jobs:
dismiss-reviews:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request_target' && github.event.action == 'synchronize' }}
steps:
- name: Dismiss Approvals
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/pulls/${{ github.event.number }}/reviews \
--jq '.[] | select(.state == "APPROVED") | .id' \
| xargs -I '{}' gh api --method=PUT -f message="Dismissed due to PR edit." \
repos/${{ github.repository }}/pulls/${{ github.event.number }}/reviews/'{}'/dismissals
trigger-review-bot:
runs-on: ubuntu-latest
name: trigger review bot
steps:
- name: Get PR number
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
echo "Saving PR number: $PR_NUMBER"
mkdir -p ./pr
echo $PR_NUMBER > ./pr/pr_number
- uses: actions/upload-artifact@v3
name: Save PR number
with:
name: pr_number
path: pr/
retention-days: 5