Require issue assignment for non-SEP pull requests by claude[bot] · Pull Request #3332 · modelcontextprotocol/modelcontextprotocol · GitHub
Skip to content

Require issue assignment for non-SEP pull requests - #3332

Open
claude[bot] wants to merge 1 commit into
mainfrom
claude/pr-issue-assignment-check
Open

Require issue assignment for non-SEP pull requests#3332
claude[bot] wants to merge 1 commit into
mainfrom
claude/pr-issue-assignment-check

Conversation

@claude

@claude claude Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Requested by Den Delimarsky · Slack thread

Motivation and Context

Before: Anyone can open a pull request against this repository without an associated issue. Unsolicited pull requests from authors who never discussed the change in an issue arrive regularly, and maintainers spend time triaging and closing them by hand.

After: Contributors making non-SEP changes find or open an issue first and get assigned before opening a pull request. A pull request that references no issue, or only issues the author is not assigned to, receives one explanatory comment linking the new CONTRIBUTING section and is closed automatically. A maintainer can reopen it once the author is assigned.

This adds an "Issue Assignment Before Pull Requests" section to CONTRIBUTING.md and a new workflow, .github/workflows/pr-issue-assignment.yml, that enforces it.

How Has This Been Tested?

The workflow YAML parses and the embedded script passes a Node syntax check. The logic was dry-run against three recent pull requests covering each outcome: #3300 (exempt, maintainer), #3296 (exempt, bot, with a linked unassigned issue), and #3288 (external author with no linked issue, would be closed).

Breaking Changes

No code or schema changes. New pull requests from external contributors are closed automatically unless they link an issue the author is assigned to or fall under an exemption.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Additional context

How it works: the workflow runs on pull_request_target for opened and reopened events, uses actions/github-script only, and never checks out PR code. It resolves linked issues with the GraphQL closingIssuesReferences query plus a case-insensitive body scan for closing keywords. On a policy failure it posts one comment and closes the pull request. The comment carries an HTML marker so a reopened pull request is not commented on twice. Every decision path is logged in the job summary.

Exemptions:

  • Pull request author association OWNER, MEMBER, or COLLABORATOR
  • Authors listed in MAINTAINERS.md, fetched from the base repo default branch via the API
  • Bot accounts, including dependabot[bot], github-actions[bot], and claude[bot]
  • Pull requests whose changed files are all under seps/ or docs/seps/
  • The maintainer-applied skip-assignment-check label

Maintainers can confirm or trim this list before merge. The skip-assignment-check label must be created when this merges.


Generated by Claude Code

@claude
claude Bot requested review from a team as code owners August 31, 2026 17:20
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.

1 participant