Fix Auto Review skipped on maintainer PRs#12
Open
scottf wants to merge 2 commits into
Open
Conversation
…authors use forks
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.
Problem
Automatic PR review (
claude / Automatic) stopped running on maintainer PRs innats-io/nats.java. The job didn't error — it was skipped, because itsif:condition evaluated false.The cause: commit #11 (5b7104f, what
v2/v2.3.0point to) added an author allow-list to the gate:The PR author (
scottf) is anats-iomember, but his membership is private. In apull_request_targetevent, the webhook payload reportsauthor_associationas a downgraded value (CONTRIBUTOR/NONE) for private members — neverMEMBER. So the allow-list never matched, and the job skipped on every maintainer PR.(The REST API returns
MEMBERfor the same PR, which is why it looked like the allow-list should have matched. The webhook payload and the REST API disagree.)Fix
Changed the gate to check whether the PR comes from a fork instead of checking the author's association:
This keeps the original security intent (don't run the secret-bearing review job for untrusted fork PRs) but no longer depends on org-membership visibility. Maintainers push branches to the repo itself (
fork == false), so their PRs now run. Fork PRs are still gated out.What changed
.github/workflows/claude.yml—claude-auto-reviewjobif:condition (and its explanatory comment) updated as above. No other job was touched; the interactive@claudejob never usedauthor_associationand is unaffected.Still to do (publish)
The fix has to reach consumers through the moving
v2tag:v2to the fix commit; cut a new immutable tag (e.g.v2.3.1).nats-io/nats.javaand confirmclaude / Automaticruns instead of skipping.