fix(ci): restrict Claude workflow mentions - #4817
Open
FanouZeng-TT wants to merge 1 commit into
Open
FanouZeng-TT wants to merge 1 commit into
FanouZeng-TT wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
Description
Fixes #4795.
Restricts the Claude Code workflow so
@claudemention triggers from comments, review comments, reviews, and newly opened issues only run for trusted repository actors:OWNER,MEMBER, orCOLLABORATOR.The existing explicit
issues.assignedtrigger for assigning the issue toclaudeis kept separately, so maintainers can still start the workflow through assignment.Publishing Your Server
Not applicable; this does not add or publish a server.
Server Details
.github/workflows/claude.ymltrigger gatingMotivation and Context
The workflow previously checked only whether the event body/title contained
@claude. That allowed any GitHub user to trigger a privileged workflow run with the repository's Claude Code action configuration.Adding
author_associationchecks keeps the mention-based workflow path available for trusted repository actors while blocking untrusted external comments from starting the job.This is separate from #4807: that PR hardens the README confirmation gate in
readme-pr-check.yml; this one hardens the Claude Code workflow trigger inclaude.yml.How Has This Been Tested?
.github/workflows/claude.ymlwith Ruby's YAML parser.git diff --check.Breaking Changes
No breaking changes for MCP servers or clients. The only behavior change is that untrusted external
@claudementions no longer start the Claude Code workflow.Types of changes
Checklist
Additional context
README and LLM-client testing are not applicable because this PR only changes a GitHub Actions workflow condition.
🤖 Generated with Claude Code