Skip to content

Review-Trigger

Review-Trigger #430

Workflow file for this run

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