Fix gh-aw install guard to handle github/gh-aw owner-prefix in gh extension list output#33168
Merged
pelikhan merged 2 commits intoMay 18, 2026
Merged
Conversation
…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
Fix gh-aw install guard to handle May 18, 2026
github/gh-aw owner-prefix format in extension listgithub/gh-aw owner-prefix in gh extension list output
Copilot created this pull request from a session on behalf of
pelikhan
May 18, 2026 21:39
View session
Contributor
There was a problem hiding this comment.
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-awandgithub/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") |
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.
Modern
ghCLI outputs extension names with owner prefix (github/gh-aw), but the generated install-guard regex only matched baregh-aw(at line-start or after whitespace). The guard always evaluated false, causinggh extension install github/gh-awto be called on an already-installed extension and failing with:Changes
pkg/workflow/mcp_setup_generator.go— adds|/to leading-character alternatives in the guard regex soowner/gh-awformat is detected:pkg/workflow/agentic_workflow_test.go/smoke-copilot.golden— updated to match new pattern*.lock.ymlworkflows — recompiled to pick up the fix