mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
workflows/check-cherry-picks: minimize more than one old review
After we removed the dismissed-review workflow, it can happen that multiple non-minimized reviews exist after a force push. To avoid cluttering the PR's history while it's actively worked on, we minimize all of them instead of only the latest.
This commit is contained in:
19
.github/workflows/check-cherry-picks.yml
vendored
19
.github/workflows/check-cherry-picks.yml
vendored
@@ -115,16 +115,17 @@ jobs:
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.payload.pull_request.number
|
||||
})).filter(review =>
|
||||
review.user.login == 'github-actions[bot]' &&
|
||||
review.state == 'CHANGES_REQUESTED'
|
||||
review.user.login == 'github-actions[bot]'
|
||||
).map(async (review) => {
|
||||
await github.rest.pulls.dismissReview({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.payload.pull_request.number,
|
||||
review_id: review.id,
|
||||
message: 'All cherry-picks are good now, thank you!'
|
||||
})
|
||||
if (review.state == 'CHANGES_REQUESTED') {
|
||||
await github.rest.pulls.dismissReview({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.payload.pull_request.number,
|
||||
review_id: review.id,
|
||||
message: 'All cherry-picks are good now, thank you!'
|
||||
})
|
||||
}
|
||||
await github.graphql(`mutation($node_id:ID!) {
|
||||
minimizeComment(input: {
|
||||
classifier: RESOLVED,
|
||||
|
||||
Reference in New Issue
Block a user