Skip to content

fix(upgrade): Capture gh aw version from stderr - #86

Merged
gursewak1997 merged 1 commit into
mainfrom
agent/fix/upgrade-yml-stderr-capture-f1849a19dd2fea9e
Sep 2, 2026
Merged

fix(upgrade): Capture gh aw version from stderr#86
gursewak1997 merged 1 commit into
mainfrom
agent/fix/upgrade-yml-stderr-capture-f1849a19dd2fea9e

Conversation

@bootc-bot

@bootc-bot bootc-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Caution

Protected files were modified in this change.
This pull request is in request_review mode and requires explicit human scrutiny before merge.

Protected files: .github/workflows/upgrade.yml

Summary

Fixes #85 by adding 2>&1 to redirect stderr to stdout when capturing the version from gh aw version.

Problem

gh aw version writes its output to stderr, not stdout. The current command in upgrade.yml:

version=$(gh aw version | awk '{print $NF}')

This pipes only stdout, resulting in an empty $version variable, which causes:

  • Empty .github/aw/gh-aw-version file
  • PR titles like "build: Upgrade gh-aw to " (missing version)
  • Commit messages with missing version numbers

Solution

Changed line 55 in .github/workflows/upgrade.yml to:

version=$(gh aw version 2>&1 | awk '{print $NF}')

The 2>&1 redirects 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 version writing to stderr:

  • Without 2>&1: version variable is empty ✗
  • With 2>&1: version correctly captured as v0.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.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Drafter for #85 · claude · sonnet45 · 45.7 AIC · ⌖ 29.2 AIC · ⊞ 4.5K ·

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

@bootc-bot bootc-bot Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Protected files were modified in this pull request and require manual scrutiny before merge.

Please verify that each protected-file change is intentional, policy-compliant, and safe:

  • Protected files: .github/workflows/upgrade.yml

@bootc-bot bootc-bot Bot added agent/review-working The review agent is actively working on this PR agent/lgtm Reviewer agent approved; ready to auto-merge labels Sep 2, 2026

@bootc-bot bootc-bot Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review complete ✓

Checked:

  • Correctness: 2>&1 properly redirects stderr to stdout for version capture
  • Consistency: Matches the existing pattern in justfile line 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.

@bootc-bot
bootc-bot Bot marked this pull request as ready for review September 2, 2026 21:51
@bootc-bot bootc-bot Bot removed agent/review-working The review agent is actively working on this PR agent/lgtm Reviewer agent approved; ready to auto-merge labels Sep 2, 2026
@gursewak1997
gursewak1997 merged commit 120f3e3 into main Sep 2, 2026
27 of 28 checks passed
@gursewak1997
gursewak1997 deleted the agent/fix/upgrade-yml-stderr-capture-f1849a19dd2fea9e branch September 2, 2026 22:20
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.

upgrade.yml: gh aw version writes to stderr, leaving version pin and PR title empty

1 participant