Repository navigation
Description
Summary
agent-approval-check reports 0/N approvals even when reviewers have approved the current head commit and have repository write access. The same problem affects a valid /approve <head-sha> comment.
The action completes successfully and posts a new pending commit status, but it never calls the collaborator-permission endpoint for any candidate. This suggests candidates are being discarded by the authorAssociation pre-filter before the authoritative permission check runs.
Environment
- Action:
anthropics/claude-code-action/agent-approval-check - Revision:
d40ddef4c030e508327d6e35a9c45f3368482c50(v1.0.195) - Private organization repository
- Events reproduced with:
pull_request_targetandissue_comment - Effective
GITHUB_TOKENpermissions:
Contents: read
PullRequests: write
Statuses: write
Steps to reproduce
- Open a PR containing a commit whose committer email matches
agent_emails. - Have multiple users with repository write access submit
APPROVEDreviews on the current head commit. - Trigger reevaluation with
ready_for_review,synchronize, or a valid/approve <current-head-sha>comment. - Inspect the action log and resulting
agent-approval-checkcommit status.
Actual behavior
The action detects the agent commit but counts no approvers:
Agent commit detected: <head-sha>
Agent activity detected. Head SHA: <head-sha>
Total approvers: 0 ()
Set status: pending — Need 2 approvals (have 0)
There are no Permission check: log entries. A subsequent valid /approve <head-sha> comment triggers an issue_comment run, but that run produces the same result and does not log Counting /approve.
Outside the workflow, querying the same PR shows that all reviews are:
APPROVED- associated with the current head SHA
- authored by users with
writerepository permission
Expected behavior
Approved reviews and /approve comments from users with verified write, maintain, or admin repository permission should count, even when authorAssociation cannot identify their organization membership.
Suspected cause
Both count_approvers() and iter_approve_commands() apply this pre-filter before calling the collaborator-permission endpoint:
if item.get("author_association") not in WRITE_ACCESS_ASSOCIATIONS:
continueThe original implementation discussion describes this as a cheap pre-filter. In a private organization, however, a repository-scoped GITHUB_TOKEN may not be able to see private organization membership reliably. A valid approver can therefore be discarded before has_write_permission() is called.
Suggested fix
Use the existing collaborator-permission endpoint as the authoritative test instead of requiring authorAssociation first:
if not permission_check(login):
continueRemoving the pre-filter should not weaken the security model because the permission endpoint already requires write, maintain, or admin. Alternatively, fall back to the permission endpoint whenever authorAssociation is missing or outside the expected set.
It would also help to log each review/comment candidate's state and association before filtering, so future false negatives can be diagnosed from workflow logs.
Related context
- agent-approval-check: 1,828-line merge-gating script has no tests and no CI coverage #1663 tracks the lack of tests and CI coverage for this component.
- The original implementation discussion retained
authorAssociationas a cheap pre-filter: Add agent-approval-check composite action #1429 (comment)
Activity
josh-bell-colab commentedon Aug 19, 2026
Additional anonymized reproduction context: approval recognition changes with organization-membership visibility.
Using the same action revision, configuration, repository, and effective token permissions:
authorAssociationpre-filter, reached the collaborator-permission endpoint, and was counted.This strengthens the evidence that
authorAssociationis causing false negatives for private organization memberships. No user or repository identifiers are included here to preserve privacy.josh-bell-colab commentedon Aug 24, 2026
@ashwin-ant how to PR reviews work on this project/prioritized?
Looking for the attached PR to get reviewed and merged to help us out ❤️
Also thanks so much @hashim Khan 🥳
josh-bell-colab commentedon Aug 25, 2026
@claude can you help me get someone to review PR that solves this issue?