fix(ci): keep sfw diff stderr out of the parsed JSON#27
Merged
Conversation
sfw writes warnings to stderr (e.g. the 'runsc not found, falling back to direct execution' notice). The diff loop captured them with 2>&1, so the warning was prepended to the JSON and 'jq' rejected it as Invalid JSON once sfw diff actually started producing output. Redirect stderr to a log instead; print it only on failure.
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.
Follow-up to the Go-toolchain fix. Now that
sfw diffactually produces output, the workflow's2>&1prepended sfw's::warning::'runsc' not found(stderr) to the JSON, sojqrejected it as Invalid JSON. Capture stdout only; route stderr to a log printed on failure. Verified locally: with2>&1jq exits 5; with stderr separated jq parses a validsemantic_match_pct.