feat(ci): restrict to PR author as triggerman#195
Merged
louisliu2048 merged 7 commits intomainfrom Mar 16, 2026
Merged
Conversation
Restores the org-membership guard (OWNER/MEMBER/COLLABORATOR) that was inadvertently dropped. Without it, any external GitHub user could trigger Claude on their own fork PRs or issues, gaining access to ANTHROPIC_API_KEY and contents:write in the base repo context. Both conditions are now required: the actor must be a trusted org member AND must be the PR/issue author (the original restriction this PR added).
With cancel-in-progress: true, any GitHub user posting a comment on a PR (even non-@claude comments) would trigger a new workflow run in the same concurrency group, immediately killing the in-progress Claude run before the authorize job could even evaluate the new commenter. Switching to false queues new runs instead, so legitimate Claude sessions run to completion regardless of other comment activity.
Moving to workflow-level permissions escalated claude-review from contents:read to contents:write and actions:read to actions:write. The review job only reads repo contents; granting write access violates least-privilege and widens the prompt-injection attack surface. Restores explicit job-level permission blocks: - authorize: no GITHUB_TOKEN scopes needed (pure shell logic) - claude-review: contents:read, actions:read (read-only review path) The workflow-level block continues to provide the write scopes needed only by the claude (code-assist) job.
When Claude bot posts a comment or review in response to a trigger, the event re-fires the workflow (issue_comment / pull_request_review_comment), causing a second job where github.actor is 'claude[bot]' with author_association: NONE, which fails authorization noisily. Adding if: "!contains(github.actor, '[bot]')" to the authorize job makes GitHub Actions skip it (and all downstream jobs that need it) for any bot actor, silently no-oping the spurious second run.
louisliu2048
approved these changes
Mar 16, 2026
Vui-Chee
added a commit
that referenced
this pull request
Mar 17, 2026
* main: fix(claude): dup comments @review and unwarranted auth step trigger (#202) feat(intercept): add bridge intercept in flashblocks (#177) add github token to claude step (#201) restore id-token (#200) fix: resolve Node compile issue, use nightly formatting, pin Rust to 1.93, and fix Claude 401s (#198) feat: integrate legacy migrate tool into bin/tools crate (#196) refactor(node): clean up main.rs (#187) feat(ci): restrict to PR author as triggerman (#195)
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.
Currently, some of our people love AI so much they trigger many actions simultaneously, but github actions can only handle at most 1 pending job request. As a result, some jobs will be dropped. Instead, we can add restrictions such as only the PR author can trigger the review and he/she can submit 1 job request at a time. AI can respond to many comments in 1 PR in 1 trigger instead of many.
This PR also prevents trigger when bot responds.