fix(build-go-attest): unmerge git show stderr from BUILD_TS#80
Merged
Conversation
Copilot review on #79: merging stderr into stdout via '2>&1' meant that if 'git show' exited 0 but wrote a warning to stderr (e.g., line-ending or core.autocrlf notices in some environments), BUILD_TS would contain that warning text. The empty-string check would still pass, and the ldflag would then be assembled with a non-timestamp value, either breaking 'go build' or shipping corrupted -X main.buildTime metadata. Drop the 2>&1 merge. BUILD_TS now captures stdout only; git's stderr flows to the Actions step log naturally where users can read the exact git error. The '::error::' annotation points them at 'the git error above' instead of inlining a potentially truncated string. Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the build-go-attest reusable workflow to prevent BUILD_TS (used for -ldflags -X main.buildTime=...) from being polluted by git show warnings/errors emitted on stderr, which could previously produce an invalid ldflag value.
Changes:
- Stop merging
git showstderr into theBUILD_TScommand substitution so only stdout is used as the timestamp. - Update the failure annotation to reference the git error in the step log rather than embedding captured stderr in the message.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Copilot on #79: merging stderr into stdout via
2>&1meant that ifgit showexited 0 with a warning on stderr,BUILD_TSwould contain that warning text — the empty-string check would still pass, and the ldflag would assemble with a non-timestamp value, breakinggo buildor shipping corrupted metadata.Drop the merge.
BUILD_TScaptures stdout only; git's stderr flows to the Actions step log naturally. The::error::annotation points users at 'the git error above' instead of inlining a potentially corrupted string.