Skip to content

PR Gate closes maintainer pull requests when org membership is private #6196

Closed

Description

@ymichael

Summary

The PR Gate closes pull requests from maintainers whose get-bb org membership is private. It labels them needs-issue and posts the "Linked issue" comment. The issue requirement from #6189 is meant for outside pull requests, but it only exempts authors whose author_association is OWNER or MEMBER. For an org member with private membership, the pull_request_target event reports COLLABORATOR, so the check applies to them.

Versions and environment

Steps to reproduce

  1. As an org admin whose get-bb membership is private, push a branch to get-bb/bb (not a fork).
  2. Open a pull request without Fixes #N.

Expected vs actual

Expected: the PR stays open, because it comes from a maintainer branch in this repository.

Actual: #6195 (author ymichael, branch bb/fix-thread-scroll-position-inconsistency-thr_nbqpibci7w in get-bb/bb) was closed 13 seconds after opening. Run https://github.com/get-bb/bb/actions/runs/40039656279 logged:

PR_AUTHOR: ymichael
PR_AUTHOR_TYPE: User
PR_ASSOCIATION: COLLABORATOR
HEAD_REPO: get-bb/bb

Evidence

  • The exemption:
    if [ "$EVENT_ACTION" != "synchronize" ] && [ "$PR_AUTHOR_TYPE" != "Bot" ] && [ "$PR_ASSOCIATION" != "OWNER" ] && [ "$PR_ASSOCIATION" != "MEMBER" ]; then
  • gh api orgs/get-bb/memberships/ymichael returns {"role":"admin","state":"active"}, and gh api orgs/get-bb/public_members/ymichael returns 404 (private membership).
  • gh api repos/get-bb/bb/pulls/6195 called with an org member's token returns author_association: MEMBER. The event payload the workflow receives says COLLABORATOR.

What I ruled out

  • Not a missing approval. COLLABORATOR is in the gate's trusted list, so only the issue check failed.
  • Not a fork. The head repository is get-bb/bb itself.

Suggested fix

Apply the linked-issue requirement only to pull requests whose head repository is not this repository. Only accounts with write access can push branches here, so that identifies maintainers whatever their membership visibility.

Found in bb thread thr_nbqpibci7w.

AGENT GENERATED

Activity

  1. added theissue type on Oct 23, 2026
  2. added
    security
    no-repro
    on Oct 23, 2026
  3. bb-slop-cop commented on Oct 23, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority Medium · Effort Low · labels security, no-repro. Filled missing classifications; replaced none.
    • Report: Reproduction and root-cause report.
    • Verdict: ALREADY FIXED · root-cause confidence high.
    • Root cause: The former linked-issue guard exempted OWNER/MEMBER but not same-repository COLLABORATOR authors. Main now skips this check for same-repository heads.
    • Verification: Nine workflow-shell cases pass in each of two clean checkouts of 5f3ceb1649921f1bd2e167aee611561bcb751248. Removing only the added guard reproduces closure. Applied no-repro because current main passes.
    • No new PR: The fix already landed in #6197; a duplicate is unnecessary.
    • Limits: Private-membership webhook behavior was not integration-tested. The broad build stopped on an unrelated missing SDK artifact; focused workflow checks pass.

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    no-reprosecurity

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions