Repository navigation
fix(ci): Post drift comment when XAML/sync-gen diff exceeds 400 lines - #23188
Merged
Merged
Conversation
The truncated diff pipeline `git diff | head -n 400` runs under `set -e -o pipefail`. When the diff exceeds 400 lines, head closes its stdin early, git diff is killed by SIGPIPE (exit 141), pipefail propagates that, and -e aborts the step. The drift-comment step is then skipped because its `if` condition never gets to evaluate. Append `|| true` so the truncation does not fail the step. Fixes #23187
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts CI drift-detection workflows so that large diffs (over ~400 lines) don’t cause the “Detect drift” step to fail due to SIGPIPE when piping git diff into head, ensuring downstream steps (posting PR comments, uploading patch artifacts, and failing the job) still run when drift is present.
Changes:
- Update
XAML Style Checkdrift console preview to tolerateheadtruncation without failing the step. - Apply the same fix to
WinAppSDK Sync Generator Checkto prevent the same failure mode there.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/xaml-style-check.yml | Prevents large drift previews from aborting the drift-detection step, allowing comment/artifact/fail steps to execute. |
| .github/workflows/winappsdk-sync-check.yml | Same SIGPIPE-tolerance adjustment for sync-generator drift previews to ensure consistent downstream behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MartinZikmund
enabled auto-merge
May 4, 2026 09:14
morning4coffe-dev
approved these changes
May 5, 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.
GitHub Issue: closes #23187
PR Type:
🏗️ Build or CI related changes
What changed? 🚀
The
XAML Style CheckandWinAppSDK Sync Generator Checkworkflows are supposed to post a PR comment with apply instructions whenever drift is detected. When the drift is larger than ~400 lines, theDetect driftstep itself fails with exit code 141 and the subsequentPost drift comment/Upload patch artifact/Fail if drift detectedsteps are silently skipped because theirif: steps.drift.outputs.drift == 'true'condition is never satisfied.Example failure: https://github.com/unoplatform/uno/actions/runs/25309801791/job/74193786071?pr=23180 — drift was detected but no PR comment was posted.
Root cause
The
Detect driftstep runs underbash --noprofile --norc -e -o pipefailand contains:git -c color.ui=always diff --cached | head -n 400When the diff is larger than 400 lines,
headcloses its stdin after reading 400 lines.git diffcontinues writing, gets SIGPIPE on its next write, and exits 141. Withpipefailthe pipeline returns 141, andset -eaborts the step before it can recorddrift=true.The same line exists in
winappsdk-sync-check.ymland is just as vulnerable; it has not tripped yet because past sync-gen drifts have stayed under 400 lines.Fix
Append
|| trueto the truncated-diff pipeline in both workflows so SIGPIPE fromheadclosing early does not abort the step. The patch artifact and thedrift=trueoutput are unaffected; the only change is that the colored, truncated console preview tolerates being cut short.PR Checklist ✅
Screenshots Compare Test Runresults. — N/A