Skip to content

fix: check add commit message first for squash merge PR detection#42

Merged
jxom merged 1 commit intomasterfrom
fix/squash-merge-pr-detection
Feb 4, 2026
Merged

fix: check add commit message first for squash merge PR detection#42
jxom merged 1 commit intomasterfrom
fix/squash-merge-pr-detection

Conversation

@jxom
Copy link
Member

@jxom jxom commented Feb 4, 2026

Problem

For squash merges, the PR number is in the commit message itself (e.g., feat: something (#37)). The previous implementation checked for merge commits first, which found the wrong PR on release branches.

Solution

Reorder the detection logic:

  1. First check the add commit's message for a PR number (handles squash merges)
  2. Fall back to looking for merge commits (handles traditional merges)
  3. Return no PR number if neither found

This ensures correct PR attribution for repositories using squash-and-merge workflow.

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
changelogs-rs Ready Ready Preview, Comment Feb 4, 2026 4:49am

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

⚠️ Changelog not found.

A changelog entry is required before merging. We've generated a suggested changelog based on your changes:

Preview
---
changelogs: patch
---

Fixed PR number detection to check the add commit message first for squash merge cases before looking for merge commits.

Add changelog to commit this to your branch.

@jxom jxom merged commit 361c721 into master Feb 4, 2026
7 checks passed
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