Skip to content

Gate Prose on the Merge Commit's Own Base, Not the Event's base.sha #2490

Closed

Description

@ptr727

What happens

validate-task.yml hands the prose gate base: ${{ github.event.pull_request.base.sha }}, and the job checks out GitHub's merge commit for the pull request. The two can disagree. base.sha is the base the pull request event recorded, while the merge commit is built on the base branch's current head. Where the base branch has moved and the event still carries the older SHA, the gate diffs the merge commit against that older base. Every commit that landed on the base branch in between is then scanned as if this pull request had written it.

Seen on

#2484, which changes one file and ten lines. Its first run passed. After a GitHub write outage left the required status job unposted, the pull request was closed and reopened to re-run it. By then #2482 had merged into develop, and the re-run's lint job logged:

HEAD is now at e4f1e76 Merge aaddb224... into 2a4974730de6de5662fff5d580c6ff937f05d3fb
  BASE: e96cb582c27ceac77b503d26e304eb9f9d653ba3
scope: 3 of 360 file(s) read, 84 changed line(s), diff against 'e96cb58...'
1 violation(s) across 1 file(s)

The merge commit was built on 2a49747, the current develop, but the diff ran against e96cb58. That scanned #2482's own comment lines, which carried the comments label on #2482 but not on #2484, and failed a pull request that adds none. Merging develop into the branch and pushing produced a fresh event and a passing run.

Fix shape

Diff against the merge commit's first parent, which is by construction the base the checkout was built on, rather than against the event's base.sha. Alternatively, resolve the merge base of HEAD^2 and HEAD^1 in the checkout. Either keeps the gate's scope equal to the pull request's own change whatever the event recorded.

Done means

  • A pull request whose base branch moved after the event was recorded is gated on its own diff only.
  • A test or a constructed workflow run shows the gate's scope on a merge commit whose first parent differs from base.sha.

Activity

  1. added a commit that references this issue on Oct 8, 2026
    2d5601d
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions