Fix copilot-review gate: use head==base, drop author_association check#1594
Merged
Conversation
The pull_request_target event payload reports author_association as CONTRIBUTOR for org members on same-repo branches (confirmed via the debug-event job added in #1592 and fired by #1593), so the previous gate filtered out every maintainer PR. Switch to head.repo.full_name == base.repo.full_name. Same-repo PRs require push access to the base repo, which is the maintainer signal we actually want. Fork PRs (where the maintainer cannot push to base) remain excluded. Also removes the now-unneeded debug-event job.
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.
Summary
author_associationallowlist withhead.repo.full_name == base.repo.full_namedebug-eventjob added in Debug: print copilot-review gate inputs #1592Why
The
debug-eventjob (landed in #1592, fired by probe PR #1593) printed:```
action=opened
draft=false
assoc=CONTRIBUTOR
user=brendancol
head_repo=xarray-contrib/xarray-spatial
base_repo=xarray-contrib/xarray-spatial
```
The REST API reports
author_association: "MEMBER"for the same PR, but thepull_request_targetwebhook payload reportsCONTRIBUTORfor org members on same-repo branches. That's why every maintainer PR since the workflow landed (#1589, the issue-1560 PR, #1592, #1593) had the job silently skipped.Same-repo branches imply push access to the base repo, which is the maintainer signal we actually want. Fork PRs still get filtered out.
Test plan
Follow-up