feat(pr-comment): capture pull_request.base.sha as base_sha#101
Merged
reuvenharrison merged 1 commit intomainfrom Apr 26, 2026
Merged
feat(pr-comment): capture pull_request.base.sha as base_sha#101reuvenharrison merged 1 commit intomainfrom
reuvenharrison merged 1 commit intomainfrom
Conversation
The action now extracts the PR's base SHA from the GitHub event payload and includes it in two places: - The free-review-page URL emitted as a ::notice:: annotation now uses the base SHA instead of the branch name, so the link is commit-pinned and stays valid even if the base branch advances after the PR was opened. - The JSON payload sent to oasdiff-service gains a github.base_sha field alongside the existing github.base_ref. The service stores it on the report so the review page can show the exact base content oasdiff compared against, rather than chasing whatever main happens to point at when the reviewer opens the page. base_ref is preserved for backward compatibility with reports stored before this field existed and for the small subset of pull_request events where pull_request.base.sha is empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The pr-comment action now extracts
pull_request.base.shafrom the GitHub event payload and propagates it in two places:::notice::): uses the base SHA instead of the branch name. The link is now commit-pinned and stays valid even if the base branch advances after the PR was opened.oasdiff-service: gains agithub.base_shafield alongside the existinggithub.base_ref. The service stores it on the report so the review page can show the exact base content oasdiff compared against, rather than chasing whatever the base branch happens to point at when the reviewer opens the page.base_refis preserved for backward compatibility with reports stored before this field existed, and for the rare case wherepull_request.base.shais empty in the event payload.Why
The review page's side-by-side viewer renders content fetched from
raw.githubusercontent.com/<owner>/<repo>/<ref>/<file>. When<ref>is a branch name likemain, the content can drift between when the PR was opened and when the reviewer opens it. Pinning to the base commit SHA fixes that.Test plan
::notice::line — confirm the URL contains a 40-char SHA, not a branch name, in thebase_sha=query parameter.github.base_shafield with the same SHA.