fix: Use correct commit SHA in Netlify deployment workflow#4462
Merged
ppawlowski merged 1 commit intomainfrom Jan 27, 2026
Merged
fix: Use correct commit SHA in Netlify deployment workflow#4462ppawlowski merged 1 commit intomainfrom
ppawlowski merged 1 commit intomainfrom
Conversation
The workflow was creating GitHub Deployment objects for the wrong commits. When a PR received a Netlify preview deployment, the workflow would create a deployment for the main branch commit instead of the PR's commit. This happened because the workflow used context.sha (the workflow run's SHA, which is always main for status events) instead of github.event.sha (the commit that received the status update). Result: GitHub showed "No deployments" on PRs despite successful Netlify previews, making the feature ineffective. This fix ensures deployments are attached to the correct commits and appear on their respective PRs.
5 tasks
Contributor
Author
|
Small fix, see #4461 (comment) |
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
Just to understand better, once this fix is applied, we will have 3 places within the same PR that can be used to see the Netlify preview:
Isn't this introducing more confusion than it should? |
Contributor
Author
|
@ppawlowski it would essentially more explicitly surface the same deploy url in the PR. Github constantly surfaces this piece of conflicting UI at the moment.
I'd say let's try it out. If we do not like it we can always remove it. |
ppawlowski
approved these changes
Jan 27, 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.


Description
Fixes a critical bug in the Netlify deployment sync workflow introduced in #4459.
Problem
The workflow was creating GitHub Deployment objects for the wrong commits. When a PR received a Netlify preview deployment, the workflow would create a deployment for the main branch commit instead of the PR's commit SHA.
Root Cause
Line 27 used
context.sha(the workflow run's SHA, always main forstatusevents) instead ofgithub.event.sha(the actual commit that received the status update).Impact
GitHub showed "No deployments" on PRs despite successful Netlify previews, making the feature completely ineffective.
Fix
Changed
ref: context.shatoref: '${{ github.event.sha }}'so deployments are attached to the correct commits and appear on their respective PRs.Evidence of Bug
595fa90)v8.0.0and use commit sha inSync Netlify Deployments to GitHub#4461 shows "No deployments")Related Issue(s)
Fixes the bug introduced in #4459. Related to the question raised in #4461.
Checklist