Repository navigation
Fix preview deployment comments in workflow_run triggered jobs - #34
Merged
Merged
Conversation
The preview for PR 33 deployed correctly but no comment appeared on the pull request. pr-preview-action posts its sticky comment by calling marocchino/sticky-pull-request-comment without a `number`, which makes that action resolve the pull request from the event payload. A workflow_run payload contains no pull request, so it had nothing to comment on. The action's `pr-number` input only feeds the deploy path, not the comment. The same blank context showed up in the deploy commit, which read "Deploy preview for PR 🛫" because the default message interpolates github.event.number. Disable the action's own comment and post it from a dedicated step that passes the validated number explicitly, and set deploy-commit-message so the commit names the pull request. Both are annotated so the next reader does not collapse them back. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KZdA347fHh4xxpdHkVwxQ
rhingo
self-requested a review
September 25, 2026 17:43
rhingo
approved these changes
Sep 25, 2026
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
This change fixes preview deployment URL comments not appearing on pull requests when the deployment is triggered via
workflow_runevents. The issue stems from thepr-preview-action's built-in comment functionality being unable to resolve the pull request number from theworkflow_runevent payload.Key Changes
pr-preview-action's automatic comment generation by settingcomment: falsesteps.pr.outputs.numbermarocchino/sticky-pull-request-comment@v2to post the preview URL comment with:numberinput (required forworkflow_runevents)Implementation Details
The root cause is that
workflow_runevent payloads don't include pull request context, so the original action's sticky comment logic fails when trying to auto-resolve the PR number. By explicitly passingsteps.pr.outputs.number(extracted in a previous step) to the comment action, we ensure the comment is posted to the correct pull request regardless of the trigger event type.https://claude.ai/code/session_015KZdA347fHh4xxpdHkVwxQ