fix(upgrade): Capture gh aw version from stderr - #86
Merged
gursewak1997 merged 1 commit intoSep 2, 2026
Conversation
gh aw version writes to stderr, not stdout. Without 2>&1, the pipe captures nothing and $version ends up empty, resulting in: - Empty .github/aw/gh-aw-version file - PR titles "build: Upgrade gh-aw to " (no version) - Commit messages with missing version Fixes #85 Generated-by: AI
Contributor
Author
There was a problem hiding this comment.
Review complete ✓
Checked:
- Correctness:
2>&1properly redirects stderr to stdout for version capture - Consistency: Matches the existing pattern in
justfileline 12 - Impact: Ensures version propagates to
.github/aw/gh-aw-version, PR titles, and commit messages - Safety: Minimal change with no behavioral side effects
Verdict: Ready to merge. The fix solves the empty version variable issue by aligning with the repository's established stderr capture pattern.
gursewak1997
approved these changes
Sep 2, 2026
gursewak1997
deleted the
agent/fix/upgrade-yml-stderr-capture-f1849a19dd2fea9e
branch
September 2, 2026 22:20
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.
Caution
Protected files were modified in this change.
This pull request is in
request_reviewmode and requires explicit human scrutiny before merge.Protected files:
.github/workflows/upgrade.ymlSummary
Fixes #85 by adding
2>&1to redirect stderr to stdout when capturing the version fromgh aw version.Problem
gh aw versionwrites its output to stderr, not stdout. The current command inupgrade.yml:version=$(gh aw version | awk '{print $NF}')This pipes only stdout, resulting in an empty
$versionvariable, which causes:.github/aw/gh-aw-versionfileSolution
Changed line 55 in
.github/workflows/upgrade.ymlto:version=$(gh aw version 2>&1 | awk '{print $NF}')The
2>&1redirects stderr (file descriptor 2) to stdout (file descriptor 1), allowing the pipe to capture the version string.Validation
Tested with a simulation that mimics
gh aw versionwriting to stderr:2>&1: version variable is empty ✗2>&1: version correctly captured asv0.87.10✓The fix aligns with the existing pattern already used in the
justfile(line 12).🤖 Generated with [Claude Code]((claude.com/redacted)
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
api.anthropic.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.