feature: lazy explanation context #75
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See: https://github.com/orgs/community/discussions/17875 | |
name: Dismiss old reviews when re-requested | |
on: | |
pull_request: | |
types: [review_requested] | |
jobs: | |
review_requested: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- name: Dismiss old reviews | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const reviews = await github.paginate(github.rest.pulls.listReviews, { | |
pull_number: context.payload.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}); | |
for (const review of reviews) { | |
if (review.state === 'CHANGES_REQUESTED' && review.user.id === context.payload.requested_reviewer?.id) { | |
console.log('Dismissing re-requested review.'); | |
await github.rest.pulls.dismissReview({ | |
pull_number: context.payload.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
review_id: review.id, | |
message: 'Review re-requested', | |
}); | |
} | |
} |