Skip to content

Fix gh-aw install guard to handle github/gh-aw owner-prefix in gh extension list output#33168

Merged
pelikhan merged 2 commits into
mainfrom
copilot/investigate-double-gh-aw-installation-issue
May 18, 2026
Merged

Fix gh-aw install guard to handle github/gh-aw owner-prefix in gh extension list output#33168
pelikhan merged 2 commits into
mainfrom
copilot/investigate-double-gh-aw-installation-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

Modern gh CLI outputs extension names with owner prefix (github/gh-aw), but the generated install-guard regex only matched bare gh-aw (at line-start or after whitespace). The guard always evaluated false, causing gh extension install github/gh-aw to be called on an already-installed extension and failing with:

there is already an installed extension that provides the "aw" command

Changes

  • pkg/workflow/mcp_setup_generator.go — adds |/ to leading-character alternatives in the guard regex so owner/gh-aw format is detected:
    -if gh extension list | grep -qE '(^|[[:space:]])gh-aw($|[[:space:]])'; then
    +if gh extension list | grep -qE '(^|[[:space:]]|/)gh-aw($|[[:space:]]|$)'; then
  • pkg/workflow/agentic_workflow_test.go / smoke-copilot.golden — updated to match new pattern
  • All *.lock.yml workflows — recompiled to pick up the fix

…rmat

The grep regex `(^|[[:space:]])gh-aw($|[[:space:]])` failed to match
`github/gh-aw` (the format that modern `gh extension list` returns),
because `gh-aw` was preceded by `/` rather than whitespace or line
start. This caused the guard check to always evaluate false, so the
install step would always attempt `gh extension install github/gh-aw`
even when the extension was already present, resulting in:

  there is already an installed extension that provides the "aw" command

Fix: add `|/` to the leading-character alternatives so the pattern also
matches the `owner/gh-aw` output format:

  (^|[[:space:]]|/)gh-aw($|[[:space:]]|$)

Also update the corresponding test assertion and golden file, and
recompile all lock files to propagate the change.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Fix gh-aw install guard: handle github/gh-aw owner-prefix format in extension list Fix gh-aw install guard to handle github/gh-aw owner-prefix in gh extension list output May 18, 2026
Copilot AI requested a review from pelikhan May 18, 2026 21:39
@pelikhan pelikhan marked this pull request as ready for review May 18, 2026 21:41
Copilot AI review requested due to automatic review settings May 18, 2026 21:41
@pelikhan pelikhan merged commit d5b8fb3 into main May 18, 2026
6 of 7 checks passed
@pelikhan pelikhan deleted the copilot/investigate-double-gh-aw-installation-issue branch May 18, 2026 21:41
Copy link
Copy Markdown
Contributor

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 fixes the generated gh-aw install guard so workflows recognize modern gh extension list output that includes an owner prefix.

Changes:

  • Updates the generated install-guard regex to match both gh-aw and github/gh-aw.
  • Updates the related unit/golden expectations.
  • Regenerates affected workflow lock files.
Show a summary per file
File Description
pkg/workflow/mcp_setup_generator.go Updates generated install guard regex.
pkg/workflow/agentic_workflow_test.go Updates install-step assertion.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden Updates golden workflow output.
.github/workflows/workflow-normalizer.lock.yml Regenerated guard in locked workflow.
.github/workflows/weekly-blog-post-writer.lock.yml Regenerated guard in locked workflow.
.github/workflows/static-analysis-report.lock.yml Regenerated guard in locked workflow.
.github/workflows/smoke-copilot.lock.yml Regenerated guard in locked workflow.
.github/workflows/smoke-copilot-arm.lock.yml Regenerated guard in locked workflow.
.github/workflows/smoke-claude.lock.yml Regenerated guard in locked workflow.
.github/workflows/security-review.lock.yml Regenerated guard in locked workflow.
.github/workflows/safe-output-health.lock.yml Regenerated guard in locked workflow.
.github/workflows/q.lock.yml Regenerated guard in locked workflow.
.github/workflows/python-data-charts.lock.yml Regenerated guard in locked workflow.
.github/workflows/prompt-clustering-analysis.lock.yml Regenerated guard in locked workflow.
.github/workflows/metrics-collector.lock.yml Regenerated guard in locked workflow.
.github/workflows/mcp-inspector.lock.yml Regenerated guard in locked workflow.
.github/workflows/example-workflow-analyzer.lock.yml Regenerated guard in locked workflow.
.github/workflows/dev-hawk.lock.yml Regenerated guard in locked workflow.
.github/workflows/deep-report.lock.yml Regenerated guard in locked workflow.
.github/workflows/daily-subagent-optimizer.lock.yml Regenerated guard in locked workflow.
.github/workflows/daily-security-observability.lock.yml Regenerated guard in locked workflow.
.github/workflows/daily-safe-output-optimizer.lock.yml Regenerated guard in locked workflow.
.github/workflows/daily-rendering-scripts-verifier.lock.yml Regenerated guard in locked workflow.
.github/workflows/daily-observability-report.lock.yml Regenerated guard in locked workflow.
.github/workflows/daily-firewall-report.lock.yml Regenerated guard in locked workflow.
.github/workflows/daily-cli-tools-tester.lock.yml Regenerated guard in locked workflow.
.github/workflows/daily-cache-strategy-analyzer.lock.yml Regenerated guard in locked workflow.
.github/workflows/daily-agentrx-trace-optimizer.lock.yml Regenerated guard in locked workflow.
.github/workflows/daily-agent-of-the-day-blog-writer.lock.yml Regenerated guard in locked workflow.
.github/workflows/copilot-token-audit.lock.yml Regenerated guard in locked workflow.
.github/workflows/cloclo.lock.yml Regenerated guard in locked workflow.
.github/workflows/aw-failure-investigator.lock.yml Regenerated guard in locked workflow.
.github/workflows/audit-workflows.lock.yml Regenerated guard in locked workflow.
.github/workflows/api-consumption-report.lock.yml Regenerated guard in locked workflow.
.github/workflows/agent-persona-explorer.lock.yml Regenerated guard in locked workflow.
.github/workflows/agent-performance-analyzer.lock.yml Regenerated guard in locked workflow.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 36/36 changed files
  • Comments generated: 1

yaml.WriteString(" run: |\n")
yaml.WriteString(" # Check if gh-aw extension is already installed\n")
yaml.WriteString(" if gh extension list | grep -qE '(^|[[:space:]])gh-aw($|[[:space:]])'; then\n")
yaml.WriteString(" if gh extension list | grep -qE '(^|[[:space:]]|/)gh-aw($|[[:space:]]|$)'; then\n")
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.

3 participants