Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/pr-review-mention-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,21 @@ jobs:
# team review requests; comment fields don't exist on pull_request events.
# For comment events we also gate at the job level on author_association so
# that the job (and its secrets) never start for external/untrusted actors.
#
# Recursion guard: the ack comment this job posts itself contains
# '@donpetry-bot' and is posted via a PAT (so it DOES re-trigger workflows,
# unlike GITHUB_TOKEN), which without this guard self-loops until GitHub's
# 2500-comment cap. Skip any comment carrying our own ack marker. We match on
# the marker (not the bot actor) because donpetry-bot is also a human account
# whose own @-mention review requests must still fire.
if: |
(github.event_name == 'pull_request' &&
github.event.requested_reviewer != null &&
github.event.requested_reviewer.login == 'donpetry-bot' &&
github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name != 'pull_request' &&
contains(github.event.comment.body, '@donpetry-bot') &&
!contains(github.event.comment.body, 'pr-review-agent mention-ack') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) &&
(github.event_name == 'pull_request_review_comment' ||
github.event.issue.pull_request != null))
Expand Down
Loading