worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

reviewer permissions

Open max-sixty opened this issue 9 months ago • 3 comments

why did the Claude action fail on #1221?

can we allow it to pass by broadening permissions / moving to pull-request-target?

max-sixty avatar Feb 27 '26 07:02 max-sixty

Thanks for flagging this — I dug into the failed claude check on #1221.

What happened: The workflow already uses pull_request_target (so secrets are available), but claude-code-action itself checks the PR author's repository permission level and requires at least write. Since bendrucker is an external contributor with read access, the action rejected it:

Checking permissions for actor: bendrucker
Permission level retrieved: read
Actor does not have write permissions to the repository

Available fix: The action has an allowed_non_write_users input that bypasses this check. It accepts a comma-separated list of usernames or * for all users:

- uses: anthropics/claude-code-action@v1
  with:
    allowed_non_write_users: "*"   # or "bendrucker,other-user"
    # ...existing config...

Security tradeoff: The action's security docs warn that this bypasses the primary security mechanism. The concern is prompt injection via PR title/body/code. For the review workflow specifically, the risk is somewhat mitigated since it uses pull_request_target (runs base branch code) and the prompt is controlled by the workflow, not the contributor. But Claude still reads the PR diff and description as context, so a crafted PR could theoretically influence its behavior.

A maintainer should decide the right tradeoff here — * is convenient but broad; listing specific trusted contributors is safer.

worktrunk-bot avatar Feb 27 '26 07:02 worktrunk-bot

please make a PR fixing

max-sixty avatar Feb 27 '26 08:02 max-sixty

PR up: #1226

Adds allowed_non_write_users: "*" to the claude-review workflow. This lets claude-code-action run on PRs from external contributors who only have read permission.

worktrunk-bot avatar Feb 27 '26 08:02 worktrunk-bot