on:
pull_request_target:
- types: [opened, synchronize, reopened]
+ types: [opened, synchronize, reopened, labeled]
# Strangely enough you have to use issue_comment to react to regular comments on PRs.
# See https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_comment-use-issue_comment.
issue_comment:
if: |
github.repository_owner == 'systemd' &&
((github.event_name == 'pull_request_target' &&
- contains(fromJSON('["MEMBER","OWNER","COLLABORATOR"]'), github.event.pull_request.author_association) &&
- github.event.pull_request.user.login != 'YHNdnzj') ||
+ (github.event.action == 'labeled' && github.event.label.name == 'claude-review' && github.event.sender.login != 'github-actions[bot]' ||
+ github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'claude-review') ||
+ github.event.action == 'opened' &&
+ contains(fromJSON('["MEMBER","OWNER","COLLABORATOR"]'), github.event.pull_request.author_association) &&
+ github.event.pull_request.user.login != 'YHNdnzj')) ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains(github.event.comment.body, '@claude review') &&
comment_id: ${{ steps.tracking.outputs.comment_id }}
steps:
+ - name: Auto-add claude-review label for trusted contributors
+ if: github.event_name == 'pull_request_target' && github.event.action == 'opened'
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: gh pr edit --repo "${{ github.repository }}" "$PR_NUMBER" --add-label claude-review
+
- name: Resolve PR metadata
id: pr
env: