Skip to content

Fix close-external-prs workflow incorrectly closing internal PRs - #7

Merged
lizkenyon merged 1 commit into
mainfrom
fix-close-external-prs
Feb 10, 2026
Merged

lizkenyon merged 1 commit into
mainfrom
fix-close-external-prs

Conversation

@lizkenyon

Copy link
Copy Markdown
Contributor

Summary

  • The orgs.checkMembershipForUser API requires read:org scope which the default GITHUB_TOKEN doesn't have, causing all PRs to be incorrectly treated as external
  • Switch to using author_association from the webhook payload (checks for MEMBER, OWNER, COLLABORATOR) with a fallback getCollaboratorPermissionLevel repo-level check
  • Update forum link to use new-topic format with Python-specific tags

Test plan

  • Open a test PR from a Shopify member account and verify it is not closed
  • Verify the workflow matches the already-deployed fix in shopify-app-php

🤖 Generated with Claude Code

The original implementation used the org membership API check which
requires read:org scope that the default GITHUB_TOKEN doesn't have,
causing all PRs to be treated as external. Switch to using
author_association from the webhook payload with a fallback repo
permission check.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lizkenyon
lizkenyon requested a review from a team as a code owner February 10, 2026 19:55
@lizkenyon
lizkenyon merged commit a80ff58 into main Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants