Skip to content

fix(build-go-attest): unmerge git show stderr from BUILD_TS#80

Merged
CybotTM merged 1 commit intomainfrom
fix/unmerge-stderr
Apr 21, 2026
Merged

fix(build-go-attest): unmerge git show stderr from BUILD_TS#80
CybotTM merged 1 commit intomainfrom
fix/unmerge-stderr

Conversation

@CybotTM
Copy link
Copy Markdown
Member

@CybotTM CybotTM commented Apr 21, 2026

Copilot on #79: merging stderr into stdout via 2>&1 meant that if git show exited 0 with a warning on stderr, BUILD_TS would contain that warning text — the empty-string check would still pass, and the ldflag would assemble with a non-timestamp value, breaking go build or shipping corrupted metadata.

Drop the merge. BUILD_TS captures 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.

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>
Copilot AI review requested due to automatic review settings April 21, 2026 05:08
@CybotTM CybotTM merged commit 5c3de82 into main Apr 21, 2026
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@CybotTM CybotTM deleted the fix/unmerge-stderr branch April 21, 2026 05:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 show stderr into the BUILD_TS command 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants