mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
Minimize resolved review threads in PRs (#3200)
* Minimize resolved review threads in PRs * cancel in progress runs when there are duplicates * add /tidy comment support
This commit is contained in:
parent
5dd8cde2f9
commit
2dcbb944a8
1 changed files with 43 additions and 0 deletions
43
.github/workflows/minimize-resolved-reviews.yml
vendored
Normal file
43
.github/workflows/minimize-resolved-reviews.yml
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# Minimize resolved PR review comments to reduce noise.
|
||||
#
|
||||
# Runs automatically on review activity for same-repo PRs. Fork PRs are
|
||||
# skipped because GITHUB_TOKEN is read-only in that context. Collaborators
|
||||
# can comment "/tidy" on any PR (including forks) to trigger manually.
|
||||
|
||||
name: Minimize Resolved Reviews
|
||||
|
||||
on:
|
||||
pull_request_review:
|
||||
types: [submitted]
|
||||
pull_request_review_comment:
|
||||
types: [created, edited]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
concurrency:
|
||||
group: minimize-reviews-${{ github.event.pull_request.number || github.event.issue.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
minimize:
|
||||
# /tidy comment: collaborators can trigger on any PR (token has write access)
|
||||
# Review events: skip fork PRs where GITHUB_TOKEN lacks write permissions
|
||||
if: >-
|
||||
(
|
||||
github.event_name == 'issue_comment' &&
|
||||
github.event.issue.pull_request &&
|
||||
contains(github.event.comment.body, '/tidy') &&
|
||||
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
|
||||
) || (
|
||||
github.event_name != 'issue_comment' &&
|
||||
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
|
||||
)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Minimize resolved review comments
|
||||
uses: strawgate/minimize-resolved-pr-reviews@v0
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue