Skip to content

Conversation

@yugannkt
Copy link
Contributor

@yugannkt yugannkt commented Dec 11, 2025

Motivation and Context

Adds a workflow that automatically comments on PRs when they're included in a release, notifying contributors their changes are live.

Approach

Custom workflow using GitHub's REST API:

  1. Triggers on release published
  2. Compares current and previous release tags
  3. Extracts PR numbers from commits
  4. Validates each is a merged PR (not an issue) via API
  5. Comments on each PR: "🎉 This pull request is included in v1.23.3!"

Key Features

Only comments on PRs (not issues) - API validation ensures this
Minimal permissions - only pull-requests: write required

How Has This Been Tested?

Tested with releases v1.23.2 → v1.23.3:

Fixes #1759

Breaking Changes

No, Its an non-breaking change which adds functionality

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

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

- Automatically comments on PRs included in a release
- Only comments on PRs (not issues) using GitHub API validation
- Compares current and previous release tags to find PRs
- Minimal permissions: only requires pull-requests:write

Fixes modelcontextprotocol#1759
@yugannkt
Copy link
Contributor Author

Ready for your review @maxisbey

@maxisbey maxisbey added enhancement Request for a new feature that's not currently supported P3 Nice to haves, rare edge cases labels Dec 11, 2025
@yugannkt
Copy link
Contributor Author

Ready for your review @felixweinberger

Copy link
Contributor

@felixweinberger felixweinberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +17 to +18
with:
fetch-depth: 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this anymore given we're now using the API only?

@felixweinberger
Copy link
Contributor

Ready for your review @felixweinberger

Thanks! Code LGTM, but curious how you tested this? Did you run this locally somehow to generate the PRs?

@maxisbey
Copy link
Contributor

Will merge this for now and we can validate it works on the next release (will be in Jan)

@maxisbey maxisbey merged commit 4807eb5 into modelcontextprotocol:main Dec 19, 2025
18 checks passed
@Kludex
Copy link
Member

Kludex commented Dec 19, 2025

If people want to be notified, they can watch the releases... 😅

@yugannkt
Copy link
Contributor Author

Thanks! Code LGTM, but curious how you tested this? Did you run this locally somehow to generate the PRs?

Hy @maxisbey
I tested this by running the workflow in my fork using GitHub Actions:

  1. Pushed the workflow to my fork
  2. Modified the trigger temporarily to run on workflow_dispatch (manual trigger)
  3. Hardcoded the release tags v1.23.2 → v1.23.3 to simulate a release event
  4. The workflow ran against the upstream repo's data (since the commit SHAs and releases are the same)
  5. Successfully detected the 5 PRs merged between those releases
  6. The actual commenting step failed with a 403 error (as expected) because my fork's GITHUB_TOKEN doesn't have permission to comment on the upstream repo's PRs. But the PR detection logic was fully validated.

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

Labels

enhancement Request for a new feature that's not currently supported P3 Nice to haves, rare edge cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add workflow to comment on PRs when released (PRs only, not issues)

4 participants