Skip to content

[Bug] Stacked PR squash merges can combine the PR author's name with the merger's email #371

Open

Description

@elecmonkey

Description

When a native GitHub Stacked PR is squash-merged by someone other than the PR author, the generated commit can contain a mixed author identity:

  • The Git author name belongs to the PR author.
  • The Git author email belongs to the user who merged the stack.

The original commits are correctly associated with the PR author. The incorrect email is introduced when GitHub creates the squashed commit.

As a result, the repository page may display the PR author's name while the API, contribution graph, contributor statistics, and other author-based tooling attribute the commit to the merger.

Public examples

Activity

  1. sanjuruk commented on Aug 5, 2026

    @sanjuruk

    We independently reproduced this on GitHub.com in a private repository with a four-PR native stack. The stack was merged from the web UI by a user other than the PR author using Squash and merge stack.

    For all four generated commits on the default branch:

    • The Pull Request API correctly reported author = User A.
    • The Pull Request API correctly reported mergedBy = User B.
    • The generated Git commit author was User A display name <User B GitHub noreply email>.
    • The committer was GitHub <noreply@github.com>.

    GitHub therefore attributed every generated commit to User B instead of the PR author. This affected every layer in the stack, so it was not isolated to one pull request.

    The stack was created and maintained with gh stack 0.1.0; the actual merge was performed through the GitHub web UI. We can provide the private repository, PR, and commit URLs through a private GitHub Support channel if useful.

  2. GigiLoria5 commented on Aug 7, 2026

    @GigiLoria5

    We hit the same issue in another private repository.

    A stacked PR authored by User A was squash-merged by User B, and the resulting commit used:

    User A's display name <User B's GitHub noreply email>
    

    We’ll be happy to provide further details if they might help to identify the problem and resolve it.

  3. dvins commented on Aug 12, 2026

    @dvins

    How on earth did this bug make it out of QA/test.

  4. added
    bugBug Reports
    topic: merge commitSquash/merge commit contents: mangled or uneditable messages and wrong author email.
    on Aug 24, 2026
  5. watson commented on Aug 27, 2026

    @watson

    We got bitten by this exact issue at Datadog in this PR: DataDog/dd-trace-js#9766

  6. dvins commented on Sep 4, 2026

    @dvins

    It's good to see it only took four weeks for someone at GitHub to acknowledge it as a bug, so thank you @skarim. But disappointing it's been given so little priority that two weeks later it's still an open issue with not even a draft PR in progress. If you work in regulated domains or environments where compliance matters this effectively makes squash merges unusable due to the misattribution.

    And don't get me started on this 4+ year old 400+ upvote issue from 2022 that also pertains to the provenance of merges:

    Rebased commits by the web interface aren't signed
    https://github.com/orgs/community/discussions/11639

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug Reportstopic: merge commitSquash/merge commit contents: mangled or uneditable messages and wrong author email.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions