mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 13:34:17 +02:00
47 lines
1.7 KiB
YAML
47 lines
1.7 KiB
YAML
# 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]
|
|
|
|
# Scope the group by event name so that the sibling events fired by a single
|
|
# review action (pull_request_review + pull_request_review_comment, same instant)
|
|
# don't cancel each other. Same-PR runs of the *same* event still supersede
|
|
# cleanly, and the last one always completes.
|
|
concurrency:
|
|
group: minimize-reviews-${{ github.event.pull_request.number || github.event.issue.number }}-${{ github.event_name }}
|
|
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 }}
|