Skip to content

Fix copilot-review gate: use head==base, drop author_association check#1594

Merged
brendancol merged 1 commit into
mainfrom
fix-copilot-review-gate
May 11, 2026
Merged

Fix copilot-review gate: use head==base, drop author_association check#1594
brendancol merged 1 commit into
mainfrom
fix-copilot-review-gate

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

Why

The debug-event job (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 the pull_request_target webhook payload reports CONTRIBUTOR for 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

  • Open a same-repo non-draft PR as a maintainer → Copilot review is requested
  • Open a same-repo draft PR → job is skipped
  • Open a PR from a fork → job is skipped

Follow-up

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.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 11, 2026
@brendancol brendancol merged commit e7c3416 into main May 11, 2026
6 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant