Skip to content

fix(ci): restrict README gate confirmations - #4807

Open
FanouZeng-TT wants to merge 1 commit into
modelcontextprotocol:mainfrom
FanouZeng-TT:fix-readme-confirmation-trust
Open

FanouZeng-TT wants to merge 1 commit into
modelcontextprotocol:mainfrom
FanouZeng-TT:fix-readme-confirmation-trust

Conversation

@FanouZeng-TT

Copy link
Copy Markdown

Description

Fixes #4796.

The README confirmation workflow currently accepts /i-promise-this-is-not-a-new-server from any commenter on a README-only PR with the readme: pending label. This lets unrelated users move a PR to readme: ready for review even though the gate is intended for the PR author or trusted maintainers.

This change keeps the existing command flow, but only allows the confirmation when the commenter is either:

  • the PR author, or
  • a trusted repository actor (OWNER, MEMBER, or COLLABORATOR).

It also adds the explicit issues: write permission to the confirmation job because the job removes and adds issue labels.

Server Details

  • Server: repository workflow
  • Changes to: README-only PR gate confirmation

Motivation and Context

The command is printed in a public bot comment. Without checking who sent it, any GitHub user can bypass the readme: pending review gate described in the workflow comment.

How Has This Been Tested?

  • Parsed .github/workflows/readme-pr-check.yml as YAML
  • Ran git diff --check
  • Verified the authorization cases locally:
    • unrelated commenter is ignored
    • PR author is allowed
    • OWNER, MEMBER, and COLLABORATOR are allowed

Breaking Changes

No breaking changes. The existing confirmation command remains unchanged for the PR author and trusted repository actors.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

This workflow never checks out or executes PR code; the change only gates an API-only label transition for README-only PRs.

🤖 Generated with Claude Code

Only allow the PR author or trusted repository actors to confirm README-only PRs, preventing unrelated commenters from moving pending submissions to ready for review.

Fixes modelcontextprotocol#4796

Co-Authored-By: Claude Code <noreply@anthropic.com>
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.

README gate confirmation command can be used by any commenter, bypassing the "readme: pending" gate

1 participant