Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enable code review workflow to post comments on PRs#3506

Merged
ewels merged 1 commit into
mainfrom
claude/fix-github-actions-access-zgbOX
Mar 12, 2026
Merged

Enable code review workflow to post comments on PRs#3506
ewels merged 1 commit into
mainfrom
claude/fix-github-actions-access-zgbOX

Conversation

@ewels

@ewels ewels commented Mar 12, 2026

Copy link
Copy Markdown
Member

Description

This PR updates the Claude code review GitHub Actions workflow to enable posting review comments on pull requests.

Changes Made

  • This comment contains a description of changes (with reason)

Workflow Permission Update:

  • Changed pull-requests permission from read to write to allow the workflow to post review comments

Workflow Configuration Update:

  • Added allowed_non_write_users: "*" parameter to the code review action to permit all users to trigger reviews

Reason

These changes enable the automated code review workflow to post feedback directly as comments on pull requests, improving the review experience by making feedback visible in the PR conversation thread rather than only in workflow logs.

Test Plan

The workflow will be tested on the next pull request created in the repository. The code review action should successfully post comments on the PR with the new permissions in place.

https://claude.ai/code/session_01JKmBxggyJKLMhu8y1rQ8hZ

The claude-code-action requires write access by default. Contributors
without write access on the repo would get "User does not have write
access on this repository" errors. Add allowed_non_write_users: "*"
to allow reviews on all PRs, and change pull-requests permission from
read to write so gh pr comment can actually post the review.

https://claude.ai/code/session_01JKmBxggyJKLMhu8y1rQ8hZ
@ewels ewels merged commit 413b5d9 into main Mar 12, 2026
10 checks passed
@ewels ewels deleted the claude/fix-github-actions-access-zgbOX branch March 12, 2026 12:31
@claude

claude Bot commented Mar 12, 2026

Copy link
Copy Markdown

Review Summary: A minimal, well-targeted fix that correctly enables the code review workflow to post PR comments. The two changes are both necessary and appropriate.

Details

Change 1: pull-requests: write permission

This is a required and correct change. The workflow was previously only able to read PR data, so it could not post comments. Upgrading to write is the minimal permission needed.

The security posture here is sound: this workflow uses the workflow_run event pattern, which runs in the context of the base branch (not the forked branch), so secrets like ANTHROPIC_API_KEY are never exposed to untrusted code from a fork. This is the recommended approach for safely running privileged workflows triggered by fork PRs.

Change 2: allowed_non_write_users: "*"

This allows the claude-code-action to proceed for PRs from users who don't have write access to the repository (e.g., external contributors). For an open-source project like MultiQC, this is a reasonable default.

One consideration worth noting: "*" is effectively unlimited — any user opening a PR will trigger an API call to Anthropic. For a high-traffic repo this could generate significant costs. A more conservative option would be a specific list of trusted external contributors, or leaving this unset and only running for write-access users. That said, given the current PR volume, this is likely fine.

Prompt Injection Risk (pre-existing, not introduced here)

The workflow already instructs Claude to use gh pr comment to post comments, and runs with --permission-mode bypassPermissions. With allowed_non_write_users: "*" now enabled for all contributors, there is a minor increase in attack surface: a malicious actor could craft a PR whose code/content attempts to manipulate Claude's behavior (prompt injection) — e.g., embedding instructions in source code comments like "IGNORE PREVIOUS INSTRUCTIONS". This is a pre-existing design concern rather than something introduced by this PR, but it's worth being aware of.

Summary

Assessment
Code quality ✅ Minimal and clean
Correctness ✅ Both changes are required for the stated goal
Security workflow_run pattern safely isolates secrets; minor prompt injection risk is pre-existing
Performance ✅ No concerns
Tests N/A — GitHub Actions workflow change; verified by next PR run

This looks good to merge.

@ewels ewels added this to the v1.34 milestone Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants