fix(ci): use pull_request_target for Slack review notifications#3731
Merged
fix(ci): use pull_request_target for Slack review notifications#3731
Conversation
The notify-slack job fails on fork PRs because the `pull_request` event does not expose secrets. Switching to `pull_request_target` gives the workflow access to `SLACK_PRIVATE_IDENTITY_WEBHOOK_URL` while remaining secure — checkout targets the base branch and no fork code is executed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the PR review-request Slack notification workflow to use pull_request_target so it can access repository secrets (Slack webhook) when a review is requested.
Changes:
- Switched workflow trigger from
pull_requesttopull_request_targetforreview_requestedevents.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ut, and author guard Address PR review feedback: - Add `permissions: contents: read` to restrict GITHUB_TOKEN scope - Explicitly check out the base SHA with persist-credentials: false - Gate the job on trusted author_association values to prevent notification spam from untrusted fork PRs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
External contributors who previously had a commit merged still get CONTRIBUTOR association, which is too broad for gating access to the private Slack webhook. Restrict to MEMBER, OWNER, and COLLABORATOR. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace fromJSON/contains with straightforward == checks for readability and maintainability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sea-snake
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
pull_requesttopull_request_targetin PR review notification workflowRationale
Using
pull_request_targetinstead ofpull_requestallows the workflow to have proper access to repository secrets and permissions when handling review requests, which is necessary for sending Slack notifications reliably.