Skip to content

fix: initial comment with --commentWithSha#487

Merged
AmirSa12 merged 1 commit intostackblitz-labs:mainfrom
skirtles-code:comment-with-sha
Apr 18, 2026
Merged

fix: initial comment with --commentWithSha#487
AmirSa12 merged 1 commit intostackblitz-labs:mainfrom
skirtles-code:comment-with-sha

Conversation

@skirtles-code
Copy link
Copy Markdown
Contributor

When using --commentWithSha, the ref is still used for the initial comment. The SHA is only used for subsequent updates to the comment using PATCH.

While this could be intentional, I don't think it is. The documentation seems to imply that it should use the SHA. I also checked the discussion on the initial PR that implemented this feature, #432. I don't see anything there that suggests the initial POST should be handled differently.

CC @btea


There are two branches (if/else) that call generatePullRequestPublishMessage with essentially the same arguments, so I've moved that up a bit to avoid the duplication. I think that duplication is what led to this problem being introduced in the first place.

I've then tweaked the logic for passing sha or ref, which was the only difference between those two branches.


I wasn't sure how to run these changes locally. I assume there's some way to run the code without deploying it to the live application, but I couldn't figure it out. While I think my change is correct, apologies in advance for opening a PR with untested code.

Copy link
Copy Markdown
Contributor

@btea btea left a comment

Choose a reason for hiding this comment

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

It appears I didn't apply the commentWithSha parameter when creating the comment.

@btea
Copy link
Copy Markdown
Contributor

btea commented Apr 12, 2026

PTAL @Aslemammad @AmirSa12

Copy link
Copy Markdown
Member

@AmirSa12 AmirSa12 left a comment

Choose a reason for hiding this comment

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

Thank you so much @skirtles-code !
and sorry for the delay

@AmirSa12 AmirSa12 merged commit dbf8239 into stackblitz-labs:main Apr 18, 2026
4 of 5 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.

3 participants